[thelist] PHP RegEx

Jon Molesa rjmolesa at consoltec.net
Wed Jul 11 23:40:41 CDT 2007

*On Wed, Jul 11, 2007 at 09:04:09PM -0700 Anthony Baratta <anthony at baratta.com> wrote:

> But not retained that because it uses the look behind option ?<=.

Will have to look up an explanation of look behind.  I see it on the
cheat sheet I saved from ILoveJackDaniels.com, but haven't investigated
the Assertions purposes yet.

> The one thing to improve this RegEx is tweak it so that (" 
> target="_new">) is not returned as part of the match groups. Not exactly 
> sure how to do that.

Unless I'm misunderstanding something:

(?:...) passive group which I take to mean, a literal group but please
don't return it.

(?:" target="_new">) should satisfy that requirement.

> Mastering Regular Expressions, Second Edition
> http://www.amazon.com/exec/obidos/ASIN/0596002890/

Have it, but my usual approach to reading only what I need to get the
result I'm looking for isn't paying off as quickly as usual.  RegEx's
are difficult to get.

Thanks again Anthony.  I'll go through all of your provided information
more tomorrow when I'm fresh.

More information about the thelist mailing list