tags:

views:

71

answers:

1

Why does

^[a-zA-Z][\w.,\$;]{0,6}$

match the abc part of the string abc! and not outright reject it?

+1  A: 

What regex engine are you using? Matching in Ruby (which I believe uses PCRE) doesn't match:

> "abc!".match /^[a-zA-Z][\w.,\$;]{0,6}$/
=> nil
Chris Heald