Uber Tools

Regex Tester

Test JavaScript regular expressions as you type, see the matches and their groups, replace and read what each part means

//g
g
i
m
s
u
y
Email
URL
IPv4
Date (YYYY-MM-DD)
Hex color
Whole word

Test text

Matches in the text

Releases: 2024-03-15, 2025-11-02 and 2026-13-01 (not a date). Next review on 2026-10-14.

Matches

0 matches

No match.

Replace

$1 or $<name> for a group, $& for the whole match

Result

Explanation

The expression a part at a time

  • (?<year>

    a group named "year", of:

  • \d

    a digit (0–9)

  • {4}

    the part before exactly 4 times

  • )

    the end of the group

  • -

    the character "-"

  • (?<month>

    a group named "month", of:

  • 0

    the character "0"

  • [1-9]

    one character of 1-9

  • |

    or

  • 1

    the character "1"

  • [0-2]

    one character of 0-2

  • )

    the end of the group

  • -

    the character "-"

  • (?<day>

    a group named "day", of:

  • 0

    the character "0"

  • [1-9]

    one character of 1-9

  • |

    or

  • [12]

    one character of 12

  • \d

    a digit (0–9)

  • |

    or

  • 3

    the character "3"

  • [01]

    one character of 01

  • )

    the end of the group


How to test a regular expression

  1. Type your regular expression and its flags (g, i, m, s, u, y), or pick a common pattern: an email, a URL, a date and more.
  2. Type or paste the text to test it on.
  3. See the matches highlighted and listed, with their positions and groups.
  4. Try a replacement with $1, $<name> or $&, and read what each part of the expression means.

Questions

Which regex flavor does it use?

JavaScript's, as used by browsers and Node.js, with named groups, lookbehind and Unicode.

Can a bad expression freeze the page?

No, it runs separately and is stopped after a moment, so an expression that backtracks forever, such as (a+)+$, can't hang your browser.

How do I learn what my regex does?

It's explained a part at a time below the matches, in plain words.

Is my text uploaded?

No, it's tested in your browser.

Related tools