misterperl has asked for the wisdom of the Perl Monks concerning the following question:
So "ABCDZABC" would match for example. I tried this:"ABC" followed by ANYTHING (or NOTHING), EXCEPT exactly one case which is "ABCZ"
but that MATCHES on "ABCZ" . My current best and ugliest solution is:/ABC[^Z]?.*$/
Can do in one regex?my $x=0; $x++ if $match =~ /^ABC.*/ && $match !~ /^ABCZ$/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sorry, didn't ask the right question about this regex yesterday (?!)
by tye (Sage) on Apr 21, 2016 at 14:47 UTC | |
by misterperl (Friar) on Apr 21, 2016 at 14:57 UTC | |
by Athanasius (Archbishop) on Apr 21, 2016 at 15:35 UTC | |
|
Re: sorry, didn't ask the right question about this regex yesterday
by stevieb (Canon) on Apr 21, 2016 at 14:55 UTC |