Regex Tester
Free regex tester: enter a pattern and test string to see matches highlighted live, with capture groups listed. Flags supported — no sign-up, no upload.
Tool inputs are processed on your device. Anonymous usage events are recorded separately.
Matches highlight live as you type.
How to use it
- 1
Enter your pattern
The regex plus flags (g, i, m, s, u) — matching runs live with every keystroke.
- 2
See matches instantly
Matches are highlighted in the test string and every capture group is listed with its index.
Use this tester to check a JavaScript regular expression against a sample string before putting it into code. Matching and highlighting happen as you type. The page also displays the total number of matches, each match's UTF-16 string index, and up to ten match records with their capture groups.
Try the pattern ^([A-Z]{2})-(\d{4})$ with the text AB-1234. It should produce one full match and two groups: AB and 1234. Change the text to AB-12345 to check a near miss; the end anchor means the extra digit should prevent a match. Turn on i and ab-1234 will also match. This example checks a two-letter code, a hyphen and four digits; it is not a general validator for every identifier.
The available flags are global (g), case-insensitive (i), multiline (m), dotAll (s) and Unicode (u). The tester adds global matching internally to enumerate all matches. Invalid syntax is shown as an error. JavaScript uses the ECMAScript regular-expression dialect, which differs from PCRE, Python and some database engines; test syntax in the runtime where you will use it.
For a broader check, include at least one expected match, one near miss, empty input and any punctuation or line breaks that appear in real data. A pattern that matches one sample is not proof that it validates all possible input. The regex generator can suggest a pattern, while this page lets you test a candidate; review both against your requirements before using it in production.
The text and pattern are processed in your browser. A limited usage event may report the tool ID, timing and success status, but not the inputs. See the Privacy Policy for the separate analytics and advertising data flows.
FAQ
Which regex dialect is used?
JavaScript (ECMAScript) — the same engine your browser runs. Patterns for PCRE/Python may differ in advanced features like lookbehind syntax.
Is my test data uploaded?
The pattern match runs in your browser. A limited usage event may report the tool ID, timing and success status, but not the pattern or test string. See the Privacy Policy for analytics and advertising data flows.
Related tools
Free Regex Generator from Plain English
Describe a text-matching rule in plain English and get a regex draft with token explanations for a selected JavaScript, PCRE, Python, Java or Go flavor.
JSON Formatter
Beautify JSON with two-space indentation or minify it to one line. Invalid input shows the browser parser error; JSON is processed locally.
Timestamp Converter
Convert positive Unix seconds or milliseconds to local time and UTC, or convert a local date-time to both timestamp units. See the magnitude threshold and supported date range.
Case Converter
Convert text into eight case styles and inspect a preview. See how whitespace, punctuation, acronyms and the 160-character preview limit affect each result.