Created
February 21, 2017 15:35
-
-
Save ufukomer/844c69e77ac985c8d14885f531243251 to your computer and use it in GitHub Desktop.
Regexp notes
This file contains hidden or 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
[^] -> any character that is not in the empty set of characters | |
. -> any number of non-newline characters | |
(+, *, ?, and {}) -> Greedy | |
(+?, *?, ??, {}?) -> Nongreedy | |
\b -> word boundary | |
\w -> alpha numerical [A-Za-z0-9_] | |
\d -> number | |
\s -> single white space | |
flags | |
g -> global (match all matches) | |
i -> case intensitive | |
^ -> beginning of input | |
$ -> end of input | |
caution! | |
^ -> could be used as both beggining and not. For example /[^\w\s]/ it correponds 'not' in here, none of word and space | |
http://eloquentjavascript.net/09_regexp.html#p_0Mx4Lf/w4/ | |
$& -> means whole match when used as a second arg of replace method | |
http://eloquentjavascript.net/09_regexp.html#p_0Mx4Lf/w4/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment