WAD Regex Analyzer

samintz

Scott Mintz
May 20, 2008
1,514
18
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,514
18
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
Thread starter Title Forum Replies Date
C Font of RegEx Analyzer Support 0
F %@regex["^-","-a"] returns 0, "^-" =~ "-a" is false (no match) Support 4
JohnQSmith Regex renaming Support 2
vefatica TPIPE: unbalanced escaped quotes in a regex? Support 5
rps Regex problem: \xnn not recognized as a hex character Support 0
old coot Regex problem: \xnn not recognized as a hex character Support 12
R Regex using ^ Support 2
T Regex engine doesn't recognize native DOS line endings Support 2
P Simple RegEx copy Support 9
D How to? Use typed envars using regex. Support 3
P Renaming with a RegEx Support 1
R How to? use @everything perl regex Support 2
C v18 regex help please Support 1
D Regex problem Support 17
mikea How to? Regex match when there shouldn't be (?) Support 18
JohnQSmith Fixed Copying with regex (several issues) Support 7
D Help needed to get a regex to work Support 3
thedave WAD Regex match on \h Support 5
Ville Regex & conditionals Support 9
samintz Regex Rename Support 2
vefatica @REGEX: behavior vs. documentation Support 2
vefatica @REGEX revisited Support 4
vefatica @REGEX question Support 6
vefatica Regex question Support 5
B Regex and Replace Support 6
Stefano Piccardi detecting BOM, FFIND multibyte regex Support 18
dcantor FFIND syntax -- is /E"regex" /X supported? Support 2
P Renaming files with regex. Support 6
B "Fun" with DO and Regex Support 12
P Need to use a regex in a "for" loop. Support 54

Similar threads