Created
January 28, 2015 01:00
-
-
Save bran921007/97a631416d3c40801e02 to your computer and use it in GitHub Desktop.
Regular Expression 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
-> matches any character | |
+ -> means match 1 or more times | |
* -> means match 0 or more times | |
{5} -> means match {n} times | |
{3,5} -> means 3 or up to 5 times | |
^ -> means NOT | |
[] -> character set | |
\ -> escape a special meaning | |
\s -> represents a space ( matches space, tab or line break ) | |
\w -> represents a word character ( lower or uppercase letter or a number ) | |
? -> character before question mark is optional | |
() -> capture group ( what is inside capture group can be used via $1, $2, $3 etc variables on page ) | |
(ht|f)tps? -> match a url of https, http, ftp or ftps | |
| -> OR | |
(:?ht|f)tps?-> match a url of https, http, ftp or ftps but don't make a capture group | |
i -> flag after /expression/i that means that the case of letters is not important |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment