[Project_owners] Help with a regular expression?

Ka-Ping Yee ping at zesty.ca
Sat Sep 3 04:32:00 EDT 2005


On Sat, 3 Sep 2005, David Murray wrote:
> Matches:
> <br>
> <hr>
> <br class="someclass">
> <br >
> <img src="http://blahblahblah">
> <hr style="something: blah;" class="somethingelse">
>
> Doesn't match:
> <br/>
> <br />
> <hr/>
> <img src="http://blahblahblah" />
> <somethingelse>

How about /<(br|hr|img)([^>]*[^\/]|)>/gi ?  That seems to match the
examples in your first list and not match the examples in your second
list.  (However, it will break down if there are ">" characters in
any attributes on these tags.)


-- ?!ng


More information about the Project_owners mailing list