ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
..what I would need to get returned, is:my $test = qq|asdfas dfas dfas df asfd[[bad tag]] [[table]] asdfa sf a +s [[asdf as f\|sfds]] as dfa sdf [[test new line]] foo|; $test =~ s{\[\[(.+)[^\]\]]}{ print "FOO: $1 \n"; }ge;
However, the code above seems to ignore the ^\]\] bit ?bad tag table asdf as f\|sfds test new line
Can someone suggest to me what I'm doing wrong? Been trying to get this working for ages, and as far as I can see, it looks fine :/C:\Users\Andy\Documents>perl test.pl FOO: bad tag]] [[table]] asdfa sf as [[asdf as f|sfds]] as dfa FOO: test new line]] fo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex question - negatives
by moritz (Cardinal) on Jan 13, 2011 at 09:43 UTC | |
by JavaFan (Canon) on Jan 13, 2011 at 10:52 UTC | |
by ultranerds (Hermit) on Jan 13, 2011 at 09:49 UTC | |
by ultranerds (Hermit) on Jan 13, 2011 at 10:24 UTC | |
by ELISHEVA (Prior) on Jan 13, 2011 at 10:43 UTC | |
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 | |
| |
|
Re: Regex question - negatives
by ELISHEVA (Prior) on Jan 13, 2011 at 10:07 UTC | |
by ultranerds (Hermit) on Jan 13, 2011 at 10:26 UTC | |
|
Re: Regex question - negatives
by eff_i_g (Curate) on Jan 13, 2011 at 17:49 UTC | |
|
Re: Regex question - negatives
by ikegami (Patriarch) on Jan 13, 2011 at 17:24 UTC | |
by JavaFan (Canon) on Jan 13, 2011 at 18:05 UTC | |
by ikegami (Patriarch) on Jan 13, 2011 at 18:17 UTC |