The Regex Tester lets you write and debug JavaScript regular expressions in real time in the browser, with instant match results, capture groups, and highlighted previews. Ideal for validating form input rules (such as email, phone number, and URL formats), extracting structured fragments from logs or text, testing replace logic, and learning the actual behavior of regex features like quantifiers, groups, and lookaheads.
A regular expression pattern (e.g. ^[\w.-]+@[\w.-]+\.\w{2,}$), flags (any combination of g/i/m/s/u), and the target text to match against. Live editing is supported; the tool gives instant feedback on match results. A default example pattern ([a-z]+) and sample text are provided to help you get started quickly.
Match count, the starting position (index) of each match, the full match content, and a list of individual capture group values. The preview area above highlights all matched fragments in the target text (yellow background). Global mode supports traversal of multiple matches; non-global mode locates the first match. If the regex syntax is invalid, a specific error message is shown.
The tool runs the entered pattern and flags against the test text, then shows matched text, index positions, and capture groups. Global mode lists multiple matches; non-global mode shows the first match only. Result count is limited to prevent problematic expressions from freezing the page. Matching runs locally.
Input example
Regex: ([\w.-]+)@([\w.-]+)\.(\w{2,})
Flags: g
Target text: Contact support@toolorbit.site or admin@example.comOutput example
2 matches found
Match 1 (index 8): support@toolorbit.site
Group 1: support
Group 2: toolorbit
Group 3: site
Match 2 (index 33): admin@example.com
Group 1: admin
Group 2: example
Group 3: comFlags are optional settings that modify the search behavior, such as ignoring case (i) or searching beyond the first match (g).
Parts of a regex enclosed in parentheses ( ) create capture groups, allowing you to extract specific substrings from a match.
Yes. The regex evaluation happens entirely in your local browser sandbox. No text or patterns are sent to our servers.