in reply to Re: negative look-ahead is ignored
in thread negative look-ahead is ignored

It's actually possible to avoid matching the extra character by using (?>...).

for my $d qw(2005-12 2005-100 2005-1- 2005-12- 2005-123- 2005-1000) { printf "%-10s: ", $d; if ( $d =~ /(?>\d{4}-\d{1,3})(?!-)/ ) { print "yep\n" ; } else { print "nope\n"; } }
2005-12 : yep 2005-100 : yep 2005-1- : nope 2005-12- : nope 2005-123- : nope 2005-1000 : yep

Use (?![-\d]) if you don't want the last to match.