in reply to Regex question - negatives

A few additional points:

Revised code incorporating above points:

my $test = q{asdfas dfas dfas df asfd[[bad tag]] [[table]] asdfa sf as + [[asdf as f\|sfds]] as dfa sdf [[test new line]] foo}; while ($test =~ m{\[\[([^\[]+)\]\]}g) { print "FOO:<$1>\n"; } #output - same as required in OP FOO:<bad tag> FOO:<table> FOO:<asdf as f\|sfds> FOO:<test new line>

Replies are listed 'Best First'.
Re^2: Regex question - negatives
by ultranerds (Hermit) on Jan 13, 2011 at 10:26 UTC
    Hi,

    Thanks - the \| is only there cos I am using qq|| (so using | in the string, causes perl to break :))

    The actual code people will use, is:

    [[foo|bar]] , not [[foo\|bar]]

    Cheers

    Andy