Private JavaScript regex tester

Regex Tester

Test a JavaScript regular expression, review matches and capture groups, and preview replacements without sending text anywhere.

Your patterns and test text stay in your browser. Nothing is uploaded or stored.

Selecting an example fills the pattern, flags, test text, and replacement preview.
Flags

Matches: 0

    What is a regular expression?

    A regular expression, usually shortened to regex, is a compact pattern for finding text. Regex is commonly used to validate input, extract values from logs, search source code, transform data, and enforce naming or formatting rules.

    JavaScript regex patterns and flags

    This tester uses your browser's JavaScript regular expression engine. Flags change how a pattern behaves: global finds every match, case-insensitive ignores letter case, multiline changes line anchors, dotAll lets a dot span newlines, Unicode enables Unicode-aware syntax, and sticky starts at the current search position.

    Capture groups and replacements

    Parentheses capture useful portions of a match for later inspection or replacement. A replacement string can reuse numbered groups such as $1 or named groups such as $<name>, which is useful for reformatting dates, identifiers, or structured text.

    Test before using a regex in production

    Try representative matches, non-matches, empty input, Unicode, and unusually long text. A pattern that works on one example can still be too broad, too narrow, or expensive on other input.

    Frequently Asked Questions

    It uses the JavaScript regular expression implementation in your browser, including the flags that browser supports.

    Yes. Enter a replacement string to preview JavaScript replacement syntax such as numbered or named capture references.

    Regex syntax and features vary between JavaScript, PCRE, Python, .NET, Java, and other engines. This page specifically tests JavaScript behavior.