Regex Tester
g: global | i: ignore case | m: multiline | s: dotAll | u: Unicode | y: sticky
Matches:0
Preview...
Regex Symbol Reference
Symbol | Description | Example |
---|---|---|
. | Matches any single character (except newline) | a.c matches abc, adc |
* | Matches 0 or more of the preceding character | ab*c matches ac, abc, abbc |
+ | Matches 1 or more of the preceding character | ab+c matches abc, abbc |
? | Matches 0 or 1 of the preceding character | ab?c matches ac, abc |
^ | Matches the start of the string | ^abc matches strings starting with abc |
$ | Matches the end of the string | abc$ matches strings ending with abc |
\d | Matches any digit [0-9] | \d+ matches 123, 456 |
\w | Matches word characters (letters, digits, underscore) | \w+ matches abc, 123, _test |
\s | Matches whitespace characters (space, tab, etc.) | a\sb matches 'a b' |
[abc] | Matches any one character in brackets | [abc] matches a, b, c |
[^abc] | Matches any character except those in brackets | [^abc] matches d, e, f |
[a-z] | Matches any character in the specified range | [a-z] matches lowercase letters |
{n} | Matches exactly n occurrences of the preceding character | a{3} matches aaa |
{n,} | Matches n or more occurrences of the preceding character | a{2,} matches aa, aaa |
{n,m} | Matches between n and m occurrences of the preceding character | a{2,4} matches aa, aaa, aaaa |
| | OR operator, matches either left or right expression | cat|dog matches cat or dog |
() | Grouping, used to capture matched substrings | (ab)+ matches ab, abab |
\ | Escape character, used to match special characters literally | \. matches a literal dot |