WAD Regex Analyzer

samintz

Scott Mintz
May 20, 2008
1,557
26
Solon, OH, USA
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
 

samintz

Scott Mintz
May 20, 2008
1,557
26
Solon, OH, USA
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