HomeToolsRegexRegex Tester

Regex Tester

Test and debug JavaScript-compatible regular expressions in real-time with syntax highlighting and group capture tables.

Regex
Load Preset Pattern
//g
Regex Flags
Test String
Match Visualization2 matches
You can reach support at support@company.com or contact our sales team at sales-info@company.co.uk. Note that invalid.email@com is not matches because of short extension rules.

Matches Detail List (2)

#IndexMatched TextCapture GroupsCopy
125support@company.comnone
274sales-info@company.co.uknone

What is a Regular Expression?

A Regular Expression (commonly abbreviated as regex or regexp) is a sequence of characters that forms a search pattern. These patterns can be used for string-matching, string-replacement, and input validation operations.

In JavaScript, regular expressions are represented by the RegExp object, which supports several key flags:

  • g (Global): Find all matches rather than stopping after the first match.
  • i (Case-insensitive): Ignore case differences when matching.
  • m (Multiline): Treat beginning (^) and end ($) characters as working across multiple lines.
  • s (dotAll): Allows the dot (.) character to match newline characters.
  • u (Unicode): Enable full Unicode support in character sets.

How to use the Regex Tester

  1. Regex Pattern: Enter your regex pattern in the pattern input box (exclude the wrapping slashes /.../).
  2. Flags: Toggle standard flags (g, i, m, s) using the checkboxes.
  3. Test String: Type or paste your sample text into the test area.
  4. View Matches: The tool will highlight matches directly within the text area and present a list of matched strings along with their indexes and any capturing groups.
  5. Load Presets: Select from common presets (e.g., email, phone number, date) to quickly load patterns.

Contribute

Find a bug or want to suggest an improvement to this tool?