> > > href\s*=\s*(['"])[^\1]+\1
> >
> > I take it this means if a single opens the attribute, only a
> > single one will be looked for as the closing quote? The back 
> > reference \1 holds the value of (['"])?
> 
> Yup, that's right.
> 
> But then again it may be that the data you're supplied with 
> is something like href="...' - in which case you wouldn't 
> want to use it...  ;)

The assumption (note: assumption) would be that any href's you get would be
URL Encoded so you wouldn't have an issue with " or ' in the URL.  Then you
could justifiably use either (typo) to close the string (although it's VERY
bad)

Remember, Regexes can only catch MOST of the cases and not all.  Don't even
attempt to catch them all... If there is an error, you fix that one, and
move on.  Trying to make a regex that's a be all and end all regex almost
never works.

Paul



-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to