How this regex tester works
This tester uses your browser's own JavaScript RegExp engine, the same one your front-end code and Node.js use, so a pattern that works here behaves the same in String.prototype.match, matchAll, replace and test. Each time you type, the pattern is compiled with the flags you ticked and run against the test string. Matches are highlighted, listed with their start and end positions, and every capture group is shown, both numbered and named.
Everything happens on your device. The pattern and text are never sent anywhere, which matters when you are testing against log lines, customer data or API keys.
Worked example: named groups and replace
The default pattern finds ISO dates and names each part: \b(?<year>\d{4})-(?<month>0[1-9]|1[0-2])-(?<day>0[1-9]|[12]\d|3[01])\b. On the sample text it finds 2 matches. The first is 2026-10-20 at position 9, with year = 2026, month = 10 and day = 20. The text 2026-13-01 is skipped because the month group only allows 01–12.
With the replacement $<day>/$<month>/$<year> the result becomes: Released 20/10/2026, patched 03/11/2026. Not a date: 2026-13-01. Named references like $<day> are easier to read than $3 and keep working if you add another group later.
Backreferences work inside the pattern too. \b(\w+)\s+\1\b with the gi flags finds a word followed by the same word, and replacing with $1 turns This is is a test of the the repeated word finder. into This is a test of the repeated word finder..
What the flags do
g (global) finds every match instead of stopping at the first. Without it, replace changes only the first match: replacing \d+ with # in “a1 b22 c333” gives “a# b22 c333”, while with g it gives “a# b# c#”.
i ignores case. m (multiline) makes ^ and $ match at the start and end of every line, which is what you want when testing a list of values one per line. s (dotAll) lets . match newlines too.
u (unicode) treats emoji and other characters outside the Basic Multilingual Plane as one character, enables \p{…} property escapes such as \p{L} for any letter, and makes the parser strict about invalid escapes. v (unicodeSets) is the newer version of u (ES2024): it adds set operations in character classes like [\p{L}--[a-z]]. You cannot combine u and v. The v box is hidden if your browser does not support it.
y (sticky) only matches starting exactly at lastIndex, which is useful for writing tokenizers. d (indices) records the start and end of each capture group; the positions appear in square brackets in the match table.
Catastrophic backtracking and the 0.5 second limit
JavaScript uses a backtracking regex engine. Patterns with nested or overlapping quantifiers, such as (a+)+$ or (\w+\s?)*$, can take exponentially longer as the input grows when there is no match, because the engine tries every way of splitting the text between the quantifiers. On a server this is a denial-of-service risk (ReDoS); in a browser it freezes the tab.
This tester runs matching in a Web Worker and stops it after 500 milliseconds, then tells you the pattern is too slow. To fix a slow pattern, make each repeated part match something the next part cannot: \w+(?:\s\w+)* instead of (\w+\s?)*, and prefer specific classes like [^"]* over .*.
JavaScript regex tips and gotchas
Escaping in strings. In a regex literal you write /\d+/, but in new RegExp("\\d+") the backslash must be doubled because the string is parsed first. Enter patterns here as you would write them between slashes.
Reusing a global regex. A regex with g or y keeps its lastIndex between calls, so calling test() twice on the same object can alternate between true and false. Use matchAll, or reset lastIndex.
Differences from PCRE and Python. JavaScript supports lookahead, lookbehind, named groups and Unicode property escapes, but not possessive quantifiers, atomic groups, \A/\Z or recursion. Inline modifiers are only supported in recent browsers, and only in the scoped form (?i:…). A pattern copied from another language may need small changes.
Validation patterns are approximations. The email and URL patterns in the library catch typos, but the only real test of an email address is sending a message to it. If you are moving config between formats, our YAML to JSON converter validates the syntax for you, and the Markdown to HTML converter turns README files into clean HTML.