Regex 101
Online resources
Online resources for regular expressions:
Website | Description |
---|---|
https://regex101.com/ | Online testing of regex, supporting different regex types / languages. Detailed explanation of the different regex parts. |
Regex basic cheatsheet
keyword | Description |
---|---|
| Matches the character a. |
| Matches either the character a or b. |
| Matches zero or one a. |
| Matches zero or more a. |
| Matches one or more a, as many times as possible, giving back as needed (greedy). |
| Matches one or more a, as few times as possible, expanding as needed (lazy). |
| Matches exactly 5 consecutive a. |
| Matches between 5 to 10 (inclusive) consecutive a. |
| Matches 5 or more consecutive a. |
| Matches any single character. |
| Matches any single space, tab or newline character. |
| Matches any single character that is not a space, tab or newline. |
| Matches any single digit character. |
| Matches any single character that is not a digit. |
| Matches any single letter, digit, or underscore. |
| Matches any single any single character that is not a letter, digit, or underscore. |
| Matches the start of the string. |
| Matches a string starting by abc. |
| Matches the end of the string. |
| Matches a string ending by xyz. |
| Matches a single character among x, y, or z. |
| Matches any character except for x, y or z. |
| Matches a single character in the range a to z. |
| Matches a single character in the range a to z or A to Z. |
| Matches any character except those in the a to z range. |
Regex examples
Regex | Description |
---|---|
| Matches an IPv4 address, with an eventual port number. |
Last updated