You are here: Re: PHP RegExp and HTML tags attributes values etc... « PHP « IT news, forums, messages
Re: PHP RegExp and HTML tags attributes values etc...

Posted by BlackDex on 10/02/87 11:10

"Eli" <eli.hen@gmail.com> wrote in message news:20050310021553.57715.qmail@lists.php.net...
> Eli wrote:
>>
>> Try:
>>
>> preg_replace('/(?<=\<)([^>]*)(\w+)=(?<!\'|\")([^>\s]+)(?=\s|\>)([^<]*)(?=\>)/U','\1\2="\3"\4',$html); Hmm.. that could be a
>> start.. and don't ask me how it works... :P
>
> Well.. problem with that, is that if you got more than 1 un-escaped attribute in a tag, the regex will fix only the first
> un-escaped attribute.
>
> for example, if $html is:
> <p class=MsoNormal id=par><font size=3 face="Comic Sans MS"><span lang=NL
> style='font-size:12.0pt;font-family:"Comic Sans MS"'>&nbsp;</span></font></p>
>
> In that case the id=par will remain as is...
> Does anyone knows how to improve it?

Just looking at the online mailinglist.. checkout this link, mabye it can help..
http://marc.theaimsgroup.com/?l=php-general&m=97975368123802&w=2

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация