Developer
Regex Tester
Try a regular expression against sample text and preview a replacement.
Free forever.
0 matches
How to test a regular expression
- Enter a pattern without surrounding slashes, then choose flags.
- Paste the text you want to test. Matches and capture groups are listed underneath.
- Add a replacement if you want to preview the result. Use $1, $2 and so on for groups.
Questions
Which regex flavour is this?
JavaScript. Lookbehind and named groups work in current browsers. A pattern copied from another language may need small changes.
What does the global flag change?
With g, every non-overlapping match is listed. Without it, only the first match is shown, which is how RegExp behaves in JavaScript.
This runs entirely in your browser. Nothing you type is sent to a server.

