“Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.”
Great online tool for debugging your regular expressions:
https://eigenstate.org/notes/regex-debug
Example:
Result:
Building
Matched: 123bar666
group 1: ba
coverage:
[0-9]*(foo|bah?|baz).?[0-9]*
^ ^^ ^^^^ ^ ^ ^ ^
Match failed at 40:
[0-9]*(foo|bah?|baz).?[0-9]*
~~~~~~~~~~~~~~~~~~~~~~^
123bath999
~~~~~~^
Recent Comments