[thelist] [ColdFusion] More RegEx Fun

Anthony Johnston - Antix tech at antix.co.uk
Wed Feb 26 02:59:01 CST 2003

morning .j,

saw this yesterday on regexlib.com

replace with <img\1 />

Cheers,  Ant.

>-----Original Message-----
>From: thelist-admin at lists.evolt.org
>[mailto:thelist-admin at lists.evolt.org]On Behalf Of .jeff
>Sent: 26 February 2003 00:31
>To: evolt.org - thelist
>Subject: [thelist] [ColdFusion] More RegEx Fun
>hey all,
>i had such good luck with my last regex questions here that i thought i'd
>ask some more.
>let's say i have some tags i want to enforce trailing slashes on.  for
><img src="images/foo.gif">
><input type="submit" value="Continue >>>">
>how would i go about doing that?
>notice that last one is a doozy and may ultimately make this next to
>impossible with regex.  i'm hoping someone here can prove me wrong.
>next, i'd like to enforce tag attribute quoting.  if any attributes are
>found unquoted, wrap them with double-quotes.
>this brings up an interesting issue though.  ponder this example:
><a href="download.html"
>   onmouseover=rollOver("download", "on")
>   onmouseout=rollOver("download", "off")>
>obviously, as soon as i wrap the event handlers with quotes the function
>calls will break (and most likely throw errors every time the page is loaded
>or worse every time the affected links are moused over).
>finally, i'd like to be able to enforce case on tags and tag attributes,
>converting it to lowercase across the board.  obviously this becomes a whole
>lot easier if i've already wrapped attribute values in quotes so i can be
>sure to avoid lower casing attribute values unnecessarily.
>any thoughts?
>jeff at members.evolt.org
>* * Please support the community that supports you.  * *
>For unsubscribe and other options, including the Tip Harvester
>and archives of thelist go to: http://lists.evolt.org
>Workers of the Web, evolt !

More information about the thelist mailing list