in reply to Re^2: Regex question - negatives
in thread Regex question - negatives
moritz's example is meant to be used with the x modifier which permits comments in a regex. For example:
my $re= qr{\[\[ # opening delimiter ( # capture... (?: # a group (?!\]\]) # that does not start with ]] . # and is a single character long )+ # and many of these groups, at least one. ) ]] # closing delimiter }x; while ($test =~ m{$re}g) { print "FOO:<$1>\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regex question - negatives
by ultranerds (Hermit) on Jan 13, 2011 at 10:51 UTC | |
by jwkrahn (Abbot) on Jan 13, 2011 at 11:10 UTC | |
by ELISHEVA (Prior) on Jan 13, 2011 at 11:00 UTC | |
by ultranerds (Hermit) on Jan 13, 2011 at 11:03 UTC |