in reply to Re: Regex to match between [ref] and [/ref]
in thread Regex to match between [ref] and [/ref]

Hi,
Thanks - tried those 2, but both give no content (but they do seem to produce 2 matches - just without any values =))
while ($test =~ m%\Q[ref]\E(?:(?!\Q[/ref]\E).)*\Q[/ref]\E%gix) { print "FOO, $1, $2 and $3 \n"; }

..and:
while ($test =~ m%\Q[ref]\E[^[]*(?:\[(?!\Q/ref]\E)[^[]*)*\Q[/ref]\E +%gix) { print "FOO, $1, $2 and $3 \n"; }
TIA

Andy

Replies are listed 'Best First'.
Re^3: Regex to match between [ref] and [/ref]
by JavaFan (Canon) on Jul 17, 2009 at 10:41 UTC
    Not very surprising, is it? Regexes that do not contain capturing parenthesis don't set $1.