Created
November 13, 2012 21:19
-
-
Save bsquared/4068456 to your computer and use it in GitHub Desktop.
Regex::Explain output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The regular expression: | |
(?-imsx:^abcdefghijklmnopqrstuvwxyz0123456789_$()+-/) | |
matches as follows: | |
NODE EXPLANATION | |
---------------------------------------------------------------------- | |
(?-imsx: group, but do not capture (case-sensitive) | |
(with ^ and $ matching normally) (with . not | |
matching \n) (matching whitespace and # | |
normally): | |
---------------------------------------------------------------------- | |
^ the beginning of the string | |
---------------------------------------------------------------------- | |
abcdefghijklmnopqrst 'abcdefghijklmnopqrstuvwxyz0123456789_' | |
uvwxyz0123456789_ | |
---------------------------------------------------------------------- | |
$ before an optional \n, and the end of the | |
string | |
---------------------------------------------------------------------- | |
( group and capture to \1 (1 or more times | |
(matching the most amount possible)): | |
---------------------------------------------------------------------- | |
)+ end of \1 (NOTE: because you are using a | |
quantifier on this capture, only the LAST | |
repetition of the captured pattern will be | |
stored in \1) | |
---------------------------------------------------------------------- | |
-/ '-/' | |
---------------------------------------------------------------------- | |
) end of grouping | |
---------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment