[Israel.pm] regex questions

Jesse Kretschmer jkrets20 at student.scad.edu
Mon Jul 19 13:01:21 PDT 2004


If the reason for using (?:) is unclear, you should know that the (?:
defines a non-capturing group.  If you plan to do any amount of text parsing
it would be good to get a copy of Mastering Regular Expressions published by
O'Reilly.

----- Original Message -----
From: "Offer Kaye" <offer.kaye at gmail.com>
To: "Perl in Israel" <perl at perl.org.il>
Sent: July 19, 2004 06.38
Subject: Re: [Israel.pm] regex questions


> On Mon, 19 Jul 2004 16:23:26 +0300, yossi.itzkovich wrote:
> > Hi,
> >
> [...snip...]
> >
> > (The best we came with was :  /\[DB((.*?)Nav|(.*?))\]/ ,  but then if we
> > have "Nav", then we have ti use $2 else we have to use $1   Ichs...)
> >
> > Yossi
> >
>
> m/\[DB(.+?)(?:Nav)*\]/
>
> Now only $1 will exist.
>
> Hope this helps,
> --
> Offer Kaye
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list