Hmm. The OPs spec was to match a WORD that starts with N and doesn't end with 00. All of the solutions I've seen posted so far work on a PHRASE (to be fair, including a phrase that consists of one word...) Fine if there is only going to be a single word to match against, but to be more general, use something like:
/\bN(?!\w*00\b)\w*\b/
as in:
my $string = q/N553342 N455673 N55788 N44200 NZ31200 NZ3120A/; my @matches = $string =~ /\bN(?!\w*00\b)\w*\b/g; print join "\n", @matches;
In reply to Re: ^N.*(?!00$)
by thundergnat
in thread ^N.*(?!00$)
by ady
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |