From 2cc7d511abdd9e22eac2d4c7dfa303b8fa965a4d Mon Sep 17 00:00:00 2001 From: Omar Santos Date: Mon, 6 Apr 2020 23:00:41 -0400 Subject: [PATCH] Update regular-expressions.md --- cheat_sheets/regular-expressions.md | 70 +++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/cheat_sheets/regular-expressions.md b/cheat_sheets/regular-expressions.md index 9457067..e1f1de4 100644 --- a/cheat_sheets/regular-expressions.md +++ b/cheat_sheets/regular-expressions.md @@ -4,3 +4,73 @@ - [RegexR - Generate Regular Expressions](https://regexr.com) - [RegexOne Exercises](https://regexone.com) - [Regex Crossword](https://regexcrossword.com) +- [Regex101](https://regex101.com/) + +## Quick Regex Reference + +

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacterMeaningExample
*Match zero, one or more of the previousAh* matches "Ahhhhh" or "A"
?Match zero or one of the previousAh? matches "Al" or "Ah"
+Match one or more of the previousAh+ matches "Ah" or "Ahhh" but not "A"
\Used to escape a special characterHungry\? matches "Hungry?"
.Wildcard character, matches any characterdo.* matches "dog", "door", "dot", etc.
( )Group charactersSee example for |
[ ]Matches a range of characters[cbf]ar matches "car", "bar", or "far"
[0-9]+ matches any positive integer
[a-zA-Z] matches ascii letters a-z (uppercase and lower case)
[^0-9] matches any character not 0-9.
|Matche previous OR next character/group(Mon|Tues)day matches "Monday" or "Tuesday"
{ }Matches a specified number of occurrences of the previous[0-9]{3} matches "315" but not "31"
[0-9]{2,4} matches "12", "123", and "1234"
[0-9]{2,} matches "1234567..."
^Beginning of a string. Or within a character range [] negation.^http matches strings that begin with http, such as a url.
[^0-9] matches any character not 0-9.
$End of a string.ing$ matches "exciting" but not "ingenious"
+