Regex Tester
Runs in your browser. Your files never leave your device.
How we keep your files private
How to use Regex Tester
- Enter your pattern and flags.
- Paste the text to test.
- Read the list of matches and groups.
Common uses
- Building and debugging patterns.
- Extracting values from text.
- Checking validation rules.
About this tool
Test JavaScript regular expressions against sample text. Matches are listed with their position and capture groups, and the global flag is applied so every match is found. Syntax follows your browser's JavaScript engine, which can differ from the regex flavour of other languages.
Worked example
The pattern \d{3}-\d{4} matches seven-digit phone numbers such as 555-0199: three digits, a dash, then four digits. Add parentheses to capture parts, for example (\d{3})-(\d{4}).
Common problems and fixes
- The pattern matches too much.
- Quantifiers like .* are greedy. Use .*? or a more specific character class.
- Special characters do not match literally.
- Escape . ? + * ( ) [ ] { } | ^ $ with a backslash when you mean the actual character.
- It works here but not in my language.
- Regex flavours differ slightly (lookbehind, named groups). Test with the same engine as your code.
Next steps
Frequently asked questions
Which regex flavour is used?
JavaScript's, as implemented by your browser. Other languages differ in details such as lookbehind and named groups.
What do the flags mean?
g finds all matches, i ignores case, m treats lines separately, s lets . match line breaks.
Can a pattern freeze the page?
Badly written patterns can be slow on large text; shorten the input if that happens.
Are my files uploaded to a server?
No. Everything runs inside your browser on your own device, so your files and text are never sent anywhere.
Is it really free?
Yes. There is no sign-up, no watermark and no limit on how often you use it.
Does it work on my phone?
Yes. It works in any modern browser on phones, tablets and computers. Very large files may be slow on older phones.