[Project_owners] Help with a regular expression?

David Murray lid2000 at tpg.com.au
Sat Sep 3 22:59:56 EDT 2005


The regexp just needs to run through the output of a midas box and make 
it well-formed XHTML, so I can throw it to an XML parser. If the user 
has been modifying the source HTML themselves and it isn't well-formed, 
a parser error pops up and tells them that they'll have to stop writing 
dodgy code.

David.

Michael Vincent wrote:
> David Murray wrote:
> 
>> Hurrah! Thankyou very much! This has been annoying me for way too long.
>>
>> David.
> 
> 
> but you might want to change that a little like this:
> 
> /< *(br|hr|img)([^>]*[^\/]|)>/gi
> 
> to catch:
> 
> < br...
> <  hr...
> <   img...
> 
> BTW: how do you replace:
> 
> <img src = http://www.foobar.org>
> 
> or:
> 
> <img src ='http://www.foobar.org'>
> 
> ???
> 
> Michael
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 
> 
> 
> 



More information about the Project_owners mailing list