if ( $value =~ m/^(?: [AN]+ # Either at least one A|N
|[AN]* # or an A|N run
(?: NP)? # Possibly interrupted by NP
[AN]* )
N$/x ){ # With a terminal N.
print "match: $value\n"; }
Something still looks suspicious to me. Your first pattern match is a choice between [AN]+ and [AN]*(NP)?[AN]*. That second choice can match the null string. Seems odd.
throop |