About online online regex testing
Paste a JavaScript RegExp pattern and a test string—matches, capture groups, and index ranges update as you type. The page uses the same RegExp engine as modern browsers (not PCRE or .NET).
Typical jobs: pull an orderId from a JSON line, find IPs and HTTP status codes in access logs, sanity-check email or URL patterns, or grab href values from HTML fragments—without opening an IDE.
Online Regex tester capabilities
Pattern & flags
Type the pattern without wrapping slashes—the UI adds flag toggles for g, i, m, s, u, and y. Global (g) finds every non-overlapping match; multiline (m) makes ^ and $ work per line in log files.
Match list & groups
- Group 0 is the full match; 1, 2, … are capturing parentheses in order.
- Named groups (?<name>…) appear with their names when the u flag is used.
- Each row shows start–end index in the test string (zero-based, inclusive start).
Highlight panel
When both pattern and text are non-empty and the pattern is valid, matched spans are highlighted above the match list so you can spot false positives in long pastes.
Flags & common recipes on the page
Below the flag buttons, a legend explains g/i/m/s/u/y. Further down, copy-paste recipes cover email, URLs, UUIDs, dates, IPv4, and query id—without auto-filling your inputs.
JavaScript vs other dialects
Lookahead, named groups, and Unicode property escapes follow ECMAScript rules. Patterns copied from PHP or Java may need tweaks—test here before dropping into production code.
Common use cases
Access log IP and status
Pattern like (\d+\.\d+\.\d+\.\d+).*?" (\d{3}) on an nginx line—group 1 is the client IP, group 2 is the HTTP status when the log format matches.
JSON field without parsing
"orderId"\s*:\s*"([^"]+)" extracts the value from a one-line API response when you only need a quick visual check.
UUID tokens in logs
A RFC 4122-shaped pattern with flag g picks correlation IDs in stack traces or env vars—verify before using the same rule in a log parser or migration script.
HTML href extraction
href="([^"]+)" on a pasted anchor tag confirms which URL would be captured before you write a crawler or email sanitizer.
Frequently asked questions
- How do I test a regex online?
- Enter the pattern in the first field, paste sample text below, and toggle flags to match your target environment. Valid patterns show a match count, highlighted spans, and each capture group value.
- Do I include /slashes/ around the pattern?
- No—type only the pattern body (what would go between slashes in JavaScript). Choose flags with the g/i/m/s/u/y buttons instead of trailing letters.
- Why does my pattern work in Python but not here?
- This page runs JavaScript RegExp. Differences include escape rules, no (?P<name>) (use (?<name>) instead), and flag syntax. Re-test after porting.
- What does group 0 mean?
- Group 0 is the entire match. Group 1 is the first parenthesized capture, group 2 the second, and so on—same numbering as RegExp.exec in JS.
- Why are there no matches with the same pattern as regex101?
- Check flags (especially g and m), whether the pattern includes JavaScript string escapes (\d vs \\d when pasted from code), and that the engine is ECMAScript not PCRE.
- Can I test replace or split?
- This release focuses on match and capture inspection. Use your app runtime or the general text tools for replace workflows.
Pattern examples (paste into Pattern)
[\w.+-]+@[\w.-]+\.\w+Loose email check — try flags gi on mixed-case texthttps?://[^\s"'<>]+http/https URLs in prose or logs (flag g)[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}UUID v1–v5 shaped tokens in logs or config (flag g)\d{4}-\d{2}-\d{2}ISO-style dates yyyy-MM-dd in copy or filenames\b(?:\d{1,3}\.){3}\d{1,3}\bIPv4-shaped tokens (not strict 0–255 validation)[?&]id=([^&]+)First query id= value — group 1 is the captured id