Online Regular Expression Tester

/ /
Processed locally · Your regex and test text are not uploaded
Matching Modes
Ctrl/⌘ + Enter
Match Results
Click a match or highlighted segment to locate and select the corresponding content in the test text

Real-time match highlighting, capture groups, line and column locations, six combinable flags, and 19 built-in common regex patterns

Online Regular Expression Tester

This tool is designed to verify the actual matching results of a regular expression against specific text. After pasting a regex and test text, the page immediately performs the match, highlights matched content in the original text, and lists each match with its value, position, line and column numbers, and capture groups. This helps you confirm that a pattern works correctly before putting it into code.

Core Features

  • Real-time matching: the tool automatically recalculates when the regex, text, or flags change. You can also click the button or press Ctrl / Command + Enter to run it manually.
  • Match highlighting: every match in the original text is marked. Clicking a highlighted block selects the corresponding text in the input box.
  • Match details: each match displays its index, matched content, start and end positions, line and column numbers, and the values of numbered capture groups.
  • Common regex patterns: 19 preset patterns are built in and grouped into accounts and numbers, network addresses, dates and times, and text and numbers. Selecting one immediately runs the match.
  • Result export: copy matching results as plain text, copy JSON containing position and group information, or download a TXT list.

Matching Modes and Flags

The tool supports six flags: global g, ignore case i, multiline m, DotAll s, Unicode u, and Sticky y. They can be combined freely, and the active flags are displayed in real time after the input field. Browser capabilities are checked when the page loads, and unsupported flags are automatically hidden to avoid unusable combinations.

Processing Capacity and Performance

  • Up to 1 million characters can be processed in a single operation. A performance notice is displayed above 200,000 characters.
  • When the text exceeds 60,000 characters, the highlight preview is automatically skipped while match details remain available.
  • Up to 2,000 match details are displayed. When there are more, the actual total number of matches is indicated.
  • The page displays the total number of matches and execution time in milliseconds, making it easier to compare the efficiency of different patterns.

Error Messages and Risk Warnings

Invalid regex syntax does not fail silently. The tool provides the error reason, line number, and column number, with a location link that directly selects the problematic character. Common issues such as unclosed character classes and parentheses can be identified. When the regex contains patterns such as nested quantifiers that may cause catastrophic backtracking, the page displays a backtracking risk warning. Empty matches are also handled to prevent infinite loops.

How to Use

  • Enter a regular expression in the regex input box, or select a common regex pattern as a starting point.
  • Select the required flags and paste the content to be checked into the test text box.
  • Review the highlight preview and match details to confirm that the matching range and groups meet expectations.
  • After verification, copy the regex or export the matching results for use in code, scripts, or data-cleaning workflows.

Use Cases

  • Development and debugging: test a regex against real examples before adding it to code.
  • Log and data processing: verify whether a pattern covers all target lines.
  • Form validation: check boundary cases for validation rules such as phone numbers, email addresses, and ID numbers.
  • Learning regex: understand the purpose of each part through highlighting and capture-group details.

Privacy and Data Security

All matching is performed locally by the browser’s built-in regex engine. Regular expressions and test text are not uploaded to a server or saved, making the tool suitable for internal logs and business data that should not be shared externally.

Test regular expression matching online

Enter a regular expression and test text to immediately view matched positions, capture groups, and match counts. Verify that the regex works as expected and quickly locate problems when it does not.
  • Match as you type: regex, text, or flag changes trigger automatic recalculation, with matched content highlighted in the original text
  • Six flags g, i, m, s, u, and y can be combined freely, while unsupported browser flags are automatically hidden
  • Match details list each match value, start and end positions, line and column numbers, and numbered capture-group contents
  • Includes 19 common regex presets grouped into accounts and numbers, network addresses, dates and times, and text and numbers
  • Syntax errors show the cause and locate the problematic character, which can be selected with one click
  • Results can be copied as plain text, copied as JSON, or downloaded as a TXT list
Suitable for development debugging, rule verification before data extraction, and learning regular expressions. A single operation can process up to 1 million characters. All matching is performed locally in the browser, and regex patterns and test text are not uploaded to a server.
Comments 0
No comments yet. Be the first to comment!
Comment content cannot be empty
0/255