We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Test regular expressions online, validate matches in real-time, and quickly extract text data.
No Match
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
A regular expression (regex) describes a text pattern: for example, \d{4}-\d{2}-\d{2} looks for four digits, a hyphen, two digits, another hyphen, then two digits. Enter the pattern by itself in the pattern field and put options such as g or i in the separate flags field. The tester applies the current browser’s JavaScript regular-expression rules as you edit the pattern, flags, or sample. It shows matched text or a syntax error.
The starting flags are gm: global search looks for multiple matches, and multiline mode changes how ^ and $ treat line boundaries. The results are the values returned by JavaScript string matching, so the flag choice affects both how much text is found and what appears in the list.
With g, the list contains successive full matches. Without it, matching stops at the first occurrence; if the pattern contains capturing parentheses, the returned list can also contain the captured parts. For instance, testing ([A-Z]+)-(\d+) against AB-12 CD-34 with g returns the two full strings. Without g, the first full match and its captured pieces may appear. The count is the number of listed values, not always the number of match positions.
Other familiar flags include i for case-insensitive matching, m for line-aware anchors, and s to let a dot match a line break. The pattern syntax and accepted flags are those supported by the browser’s JavaScript engine.
Source: MDN, Regular expressions — JavaScript explains JavaScript pattern syntax, flags, and how global matching differs; JavaScript context; checked 2026-09-28.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Include examples that should match and near-misses that should not. A pattern that passes one ideal example may still be too broad or too narrow on real input.
For a date-shaped string, enter \d{4}-\d{2}-\d{2}, without surrounding slash marks. Leave g enabled to see repeated matches; add or remove one flag at a time to isolate a change.
Review each listed value and the match count. The copy control places the listed values on separate lines. If the result is empty, check the spelling, escaping, flags, and whether the sample contains the expected characters.
To extract order codes from Order A-102; Order B-305, try [A-Z]-\d{3} with g. You should see A-102 and B-305.
Use cases
See how the tool fits into real work and everyday tasks.
Try a pattern on representative lines to extract IDs or date-shaped strings, then review the results before using the rule in a script.
Check whether sample entries have the expected text shape. Pair valid-looking examples with malformed ones to spot an overly permissive pattern.
Share a small sample and pattern with a teammate so both can see how case, line breaks, and boundaries affect the same match.
Q&A
Find concise answers to common questions and confusing cases.
Add g to search for multiple matches. Without it, this tester shows only the first matching result.
Without g, JavaScript matching can include capturing-group values after the full match. Use non-capturing parentheses such as (?:...) when grouping without capturing, or use g to list full matches throughout the text.
Escape the regex metacharacter with a backslash: write \. to match a period rather than “any character.” The pattern field is not a JavaScript source string, so do not add an extra string-literal escaping layer.
No. It lists matching values and a count; it does not preview replacements or provide a structured capture-group or position view.
Notes
Review scope, result limitations, and important precautions before use.
Related
Discover related tools, collections, and available API capabilities.