Welcome!

By registering with us, you'll be able to discuss, share and exchange private messages with other members of our community.

SignUp Now!

WAD Regex Analyzer

samintz

Scott Mintz
May
1,580
28
When I enter this regex: [A-Za-z0-9_]+

The analyzer says Hello World matches. That makes sense because it is matching Hello and ignoring the space and World at the end.

If I change the regex to [A-Za-z0-9_]+$
The analyzer shows green check until I hit the space (Hello<space>) then it shows red X. However, if I continue to type World, it changes back to green check.

Since the space is not part of the allowed characters, why is it succeeding?

-Scott
 
Never mind. User error. Second example was matching the end of the expression and ignoring the beginning.
Changing the regex to ^[A-Za-z0-9_]+$ did the trick.
 

Similar threads

Back
Top