[thelist] [ColdFusion] More RegEx Fun

.jeff jeff at members.evolt.org
Thu Feb 27 13:51:01 CST 2003


> From: Joshua Olson
> > let's say i have some tags i want to enforce trailing
> > slashes on. [...] how would i go about doing that?
> http://concepts.waetech.com/unclosed_tags/
> I'm sure some smarty will try to break this code...
> please do.  I used the XHTML 1.0 reference for the
> definitions to a certain extent.  For example, the spec
> does call for limitations as to which characters may be
> in attribute values.  The regex's I created do not since
> I was trying to cater the results to .jeff's example.
> I deviated for simplification in a couple other places
> as well, but I hope that these rules will catch most
> common derivations of tags.

the only thing i was hoping to catch that you didn't was a non-closing tag
with a trailing slash without the optional leading space.  i know the
leading space is optional, but without it some browsers hork badly.  so, i'd
like to catch <br/> as invalid and convert to <br />.  my guess is this will
likely need to be an entirely separate check though.

other than that i found what you put together to be awesome.  thanks a ton.
i'll be playing around with that today to see what i can do with it.



jeff at members.evolt.org

More information about the thelist mailing list