Skip to content
UtilPick.
My toolbox
All tools
Favorites
Saved tools

Loading…

Recently used

Tools you open will appear here.

Get the desktop app
Settings
UtilPick.
All tools
All tools/Regex Tester

Regex Tester

Enter a pattern and see matches, capture groups and a piece-by-piece explanation as you type. Nothing you enter is sent to a server.

Loading the tool…

User reviews

No reviews yet. If you’ve used this tool, be the first to leave one.

User reviews

No reviews yet.

Write a review

Checking your sign-in status…

    From first step to finished result

    Regex Tester: complete guide

    Walk through the steps and examples, or jump straight to the topic you need.

    How to use
    Examples & choices
    Troubleshooting
    FAQ

    At a glance

    Syntax
    Browser JavaScript regex.
    Flags
    You can turn six flags on and off: g, i, m, s, u and y.
    What it shows
    The matched spot, the start position, numbered groups and named groups.
    Replacing
    It uses the $1, $& and $<name> notation as is.
    Hang protection
    It runs in a separate worker and ends it if it passes 2 seconds.
    Size
    Text up to 200,000 characters, up to 5,000 matches, and the list shows the first 200.
    Safety
    Even if the test text contains tags, it is shown only as characters.
    Where it runs
    The pattern and the text are not sent to a server.

    How to use Regex Tester

    1. 01

      Enter a pattern

      Write only the pattern between the slashes. You can also pick one from the common patterns and adapt it. If the pattern is invalid, the tool shows the reason the browser reports as is.

    2. 02

      Try turning on flags

      Turn on i to ignore case, or m to apply ^ and $ on every line. Hover over each button to see what it does.

    3. 03

      Check the matches and groups

      The matches are highlighted on the text. In the list below, you can see the position each match started at and the values captured in parentheses, one by one.

    4. 04

      Preview the replacement too

      Type the replacement text and the result appears right away. You can reuse groups like $1, so swapping the order of parts is checked too.

    What it’s good for

    It shows where and why a match happened

    It highlights the matches right on top of your text, and below it lists each match with the position it started at and the values captured by each group in parentheses. Named groups are shown by their names, so when you use something like (?<year>\d{4}) you can immediately check that the value goes in properly. A group that did not match is written as "no match" rather than left blank.

    It handles patterns that hang safely

    A pattern that repeats the same thing in nested layers, like (a+)+, makes the computation explode and freezes the browser once the text gets even a little long. This tool runs the matching in a separate worker and ends that worker if it passes 2 seconds. The page does not freeze, and a message explains why it took so long and how to fix it.

    Worked examples

    Finding only dates

    Input and settings
    Pattern \d{4}-\d{2}-\d{2} · flag g
    Result
    The two spots 2026-09-10 and 2026-10-01 are highlighted.
    It only looks at the shape. A value like 2026-13-45 also matches, so you need to check separately whether it is a real date.

    Swapping parts

    Input and settings
    Pattern (?<y>\d{4})-(?<m>\d{2}) · replacement $<m>/$<y>
    Result
    2026-09 → 09/2026
    You can reuse named groups as they are.

    Flags that are often confused

    Swipe the table sideways to see the rest.

    Flags that are often confused
    FlagWhen onWhen off
    g (global)Finds every matchFinds only the first match
    i (ignore case)Treats A and a as the sameDistinguishes them exactly
    m (multiline)^ and $ match at every lineThey match only at the start and end of the whole text
    s (dot matches newline). also matches line breaks. matches everything except line breaks

    When the result isn’t what you expected

    It says the pattern took too long and was stopped

    Repeating the same thing in nested layers, like (a+)+ or (.*)*, makes the number of possibilities explode as the text gets longer. Remove the inner repetition or narrow the range. It cuts off at 2 seconds so the page does not freeze.

    It finds only one match

    Global (g) is off. Turn it on to find them all.

    I want to find a dot (.) or an asterisk (*) literally

    Put a backslash in front of it. If you use the button that turns the first line of your text into a literal-match pattern, it is handled in one step.

    The result differs in another language

    This tool uses browser JavaScript syntax. Some notation differs from Python or Java, so check when you move a pattern.

    Key terms

    Group
    The part wrapped in parentheses. You can pull out the matched value separately.
    Named group
    The form (?<name>...). You pull it out by name instead of by number.
    Flag
    A letter after the pattern, like g or i. It changes how matching works.
    Catastrophic backtracking
    A state where the number of possibilities explodes and the computation never finishes.

    Regex Tester FAQ

    Do I have to turn on Global (g)?

    If you do not, it finds only the first match. In code, too, only the first match is used without g, so the tool deliberately shows it that way and notes the fact on screen.

    Which language's regex is this?

    It is browser JavaScript regex. Some notation differs from Python or Java. In particular, support for lookbehind and Unicode property notation can differ by environment.

    Is my text uploaded to a server?

    No. Both the pattern and the text are handled only inside this browser.

    Can a pattern match an empty string?

    Yes. A pattern like a*, which also matches empty spots, can loop forever because the position does not move, so the tool advances one character at a time and shows the match in the list as (empty string).

    How many matches does it find?

    It finds up to 5,000 and shows the first 200 in the list. The highlighting applies to everything found.

    Can I put HTML in the test text?

    Yes. It is drawn on screen only as characters, so tags are not executed.

    Jump to a topic

    • #regex tester
    • #capture group
    • #flags
    • #hang protection
    • #backtracking
    • #empty string

    Reviewed 2026.09.09

    Related tools

    View all
    Text CompareText
    JSON FormatterDeveloper
    Clean Up TextText
    UtilPick

    Simple tools for a complicated day. A free collection of online utilities.

    Service

    About UtilPick Get the desktop app

    Help

    Request a toolReport a problemContactinfo@utilpick.com

    Policies

    Privacy Policy (Korean)Terms of Use (Korean)
    Business registration no. 365-47-00936 (Republic of Korea)
    © 2026 UtilPick
    Featured on Twelve ToolsUtilPick - Featured on Startup FameFazier badgeFeatured on LaunchIgniter
    HomeSearchSavedMore
    Try your pattern instantly

    Pattern and flags

    /
    /g
    FlagsGlobal (g)
    Flags
    Common patterns
    Pattern explained

    The pattern broken down piece by piece from the left. Repetition marks belong to the piece right before them.

    1. \d{4}One digit (0–9) · repeated 4 times
    2. -The text "-" exactly
    3. \d{2}One digit (0–9) · repeated 2 times
    4. -The text "-" exactly
    5. \d{2}One digit (0–9) · repeated 2 times

    Your text and pattern never leave this browser. Matching runs in a separate worker, so a slow pattern can’t freeze the page.

    Matches

    Matches—Enter a pattern to see matches instantly.