How to use it
Type the expression
Without the slashes; pick flags below it, or start from a ready-made pattern.
Paste text
Matches are highlighted at once, with a list of every match, its groups and positions.
Replace
Tick Replace and write the new text with $1, $<name> or $& for the whole match.
Symbols you’ll use a lot
| Symbol | Meaning |
|---|---|
\d | Digit 0-9 |
\w | Letter, digit or _ (ASCII only) |
\p{L} | Any letter in any script (with u) |
\s | Space, tab or newline |
^ $ | Start and end (of each line with m) |
(?<name>…) | Named group |
a{2,5} | 2 to 5 times |
Good to know
\w is ASCII only. In JavaScript \w doesn’t match é or Arabic. Use \p{L} with the u flag for letters in any language.
Safe from hangs. Patterns like (a+)+$ can take years on some inputs (catastrophic backtracking). We run the expression in a separate thread and stop it after 2 seconds.
JavaScript flavour. Results match browsers and Node.js. Python, PHP and others agree on the basics but differ in details.
FAQ
What is a regex?
A regular expression describes a text pattern, like “05 then 8 digits” for a mobile number, to search for it, validate it or replace it. Nearly every programming language supports them.
How do I match non-English words?
Use \p{L}+ (any letter) or \p{Script=Arabic}+ with the u flag.
What’s the difference between the u and v flags?
u enables full Unicode and \p{…}; v is newer and adds set operations like [\p{L}--[a-z]]. They can’t be combined.
Is my text sent anywhere?
No. Testing happens in your browser.
