in reply to ^N.*(?!00$)

I would personnally use the !~ operator

% perl -le'print "Good" if "NZ312000" !~ /^N.*?00$/' % perl -le'print "Good" if "NZ312005" !~ /^N.*?00$/' Good % perl -le'print "Good" if "NZ312050" !~ /^N.*?00$/' Good

Update: all of the above is indeed flawed, and more elegant solutions than splitting the regex in two (/^N/ and /00$/) have already been pointed out.

Replies are listed 'Best First'.
Re^2: ^N.*(?!00$)
by Fletch (Bishop) on Jun 06, 2005 at 12:21 UTC
    $ perl -le 'print "Oops" if "POODLESNOODLESSTRUDELS" !~ /^N.*?00$/' Oops

    --
    We're looking for people in ATL