Need more special characters?
Add a key with a new character (and an optional description):
Sample regex | Sample match | ||
Any character except line break | a.c | abc a.c | |
Escapes a special character | a\.c | abc a.c |
one Unicode digit in any script | file_\d_\d | file_9_ ٩ | |
"word character": Unicode letter, ideogram, digit, or underscore | \w-\w\w\w | 字-ま_۳ | |
"whitespace character": any Unicode separator | a\sb\sc | aaaa b cccdde | |
One character that is not a digit | 2\D\D\D | 12ABC34 | |
One character that is not a word character | \W\W\W\W\W | *-+=) | |
One character that is not a whitespace character | \S\S\S\S | Yo3) Y o3 |
Tab | T\t\w\w | A T ab | |
Carriage return character | see below | ||
Line feed character | see below | ||
Line separator on Windows | AB\r\nCD | AB CD |
Once or none | plurals? | plural and plurals | |
Zero or more times (greedy) | aB*a bB*b aB* | aBBa bb aBBBBB | |
One or more (greedy) | Version \w-\w+ | Version A-b1_100 | |
Exactly three times | \D{3} | ABC | |
Two to four times (greedy) | \d{2,4} | 156 | |
Three or more times (greedy) | \w{4,} | regex_ |
Once or none (lazy) | plurals? | plural and plurals | |
One or more (lazy) | Version \w-\w+? | Version A-b1_100 | |
Two to four times (lazy) | \d{2,4}? | 156 | |
Three or more times (lazy) | \w{4,}? | regex_ | |
Zero or more times (lazy) | aB*a b* aB*? | aBBa bb aBBBBB |
Alternation / OR operand | 22|33 | 22 + 11 = 33 | |
Capturing group | A(nt|pple) | An Ant on an Apple | |
Contents of Group 1 | r(\w)g\1x | regex not rigex | |
Contents of Group 2 | (\d\d)\+(\d\d)=\2\+\1 | 12+65=65+12 | |
Non-capturing group | A(?:nt|pple) | An Ant on an Apple |
One of the characters in the brackets | T[ao]p | Tap and Top | |
One of the characters in the range from x to y | [A-Z]+ | UPPERcase LEtterS | |
One character that is not x or y | [^12] | A1b2+1 | |
One of the characters not in the range from x to y | [^a-z]{3} | abA1! cd |
Start of line | ^abc [1-9]* | abc 18 abc 19 | |
End of line | abc [1-9]*$ | abc 18 abc 19 | |
Word boundary: position where one side only is a letter, digit or underscore | \bكتب\b | كتب مكتبه كتبه | |
Not a word boundary | \Bكتب\B | كتب مكتبه كتبه |
Positive lookahead | (?=\d{10})\d{5} | 0123456789 | |
Positive lookbehind | (?<=\d\s)cat | 1 cat white cat | |
Negative lookahead | (?!theatre)the\w* | the theatre theme | |
Negative lookbehind | (?<!USD)\d{3,} | USD300 = GBP250 |
Any Arabic character in Unicode | |||
Any Arabic punctuation character in Unicode | |||
Any Arabic diacritic in Unicode | |||
Any Arabic/hindi number in Unicode |
For finding Unicode characters by name, with easy copying:
For inspecting Unicode code points of a text:
Unicode blocks related to Arabic: