in reply to Regex question - negatives

| v $test =~ s{\[\[(.+?)[^\]\]]}{ print "FOO: $1\n"; }ge;

I'm really not sure why you are replacing the tags with the result of print, though. Unless the print is just a placeholder until you get this working, the code should be

while ($test =~ s{\[\[(.+?)[^\]\]]}g) { print "FOO: $1\n"; }

Replies are listed 'Best First'.
Re^2: Regex question - negatives
by JavaFan (Canon) on Jan 13, 2011 at 18:05 UTC
    The pattern is wrong, and you don't want s///.
    while ($test =~ m{\[\[(.+?)\]\]}g) { print "FOO: $1\n"; }
      ack, that's what I thought I was posting. Thanks.