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
(['"])?

Ade

-----Original Message-----
From: Tim Blair [mailto:[EMAIL PROTECTED]
Sent: 12 June 2003 17:16
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] OT - Perl RegEx



Also, you could try using backreferences to match only the correct
closing quote:

href\s*=\s*(['"])[^\1]+\1

(['"])  match either " or ' to start with
[^\1]+  match one or more chars not the same as the opening quote
\1      match the same closing as opening quote

Just makes it slightly more "correct" IMO...

Tim.

PS. Above regex not actually tested, doing it OTTOMH as I'm running out
of the door...

-------------------------------------------------------
RAWNET LTD - Internet, New Media and ebusiness Gurus.
Visit our new website at http://www.rawnet.com for
more information about our company, or call us free
anytime on 0800 294 24 24.
-------------------------------------------------------
Tim Blair
Web Application Engineer, Rawnet Limited
Direct Phone : +44 (0) 1344 393 441
Switchboard : +44 (0) 1344 393 040
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
-------------------------------------------------------




-- 
** 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]

-- 
** 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