TinyTools

🧪 TEXT

Regex Tester & Debugger

Test JavaScript regex live with highlighting, plain-language explanations, replace preview, and community patterns.

Your files are processed directly on your device and are not uploaded to our servers.

g global · i ignore case · m multiline · s dot-all · u unicode · y sticky

Test text — 1 match

Contact hello@example.com or call +84 901 234 567. Release on 2026-10-11 at 09:30.

Matches

  1. #1hello@example.comat index 8

What does this pattern mean?

[\w.+-]
Character class: matches one of these characters
+
One or more of the previous
@
Literal "@"
[\w-]
Character class: matches one of these characters
+
One or more of the previous
\.
Literal "." (escaped)
[\w.]
Character class: matches one of these characters
+
One or more of the previous

Replace

Contact [redacted] or call +84 901 234 567. Release on 2026-10-11 at 09:30.

Community patterns (12)

  • Email address

    /gi
    [\w.+-]+@[\w-]+\.[\w.]+

    Practical email matcher for forms and pasted text. Not fully RFC-compliant by design.

    formvalidation
  • URL (http/https)

    /gi
    https?://[^\s/$.?#].[^\s]*

    Finds http and https links inside paragraphs.

    linkscrape
  • IPv4 address

    /g
    \b(?:\d{1,3}\.){3}\d{1,3}\b

    Matches dotted IPv4 addresses. Pair with a range check for strict validation.

    networklog
  • Date YYYY-MM-DD

    /g
    \b\d{4}-\d{2}-\d{2}\b

    ISO-style dates. Add month/day range checks for strict validation.

    datevalidation
  • Time HH:MM (24h)

    /g
    \b([01]\d|2[0-3]):[0-5]\d\b

    Strict 24-hour clock times with capture group for the hour.

    datevalidation
  • International phone

    /g
    \+?[0-9][0-9 .()-]{6,}[0-9]

    Lenient phone finder for pasted contact blocks. Normalize before dialing.

    contactform
  • UUID

    /gi
    \b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b

    Matches UUID v1-v5 strings in logs and API payloads.

    idlog
  • Hex color

    /g
    #(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\b

    Finds 3, 6, and 8-digit hex colors in CSS.

    cssdesign
  • URL slug

    /
    ^[a-z0-9]+(?:-[a-z0-9]+)*$

    Strict full-string slug check: lowercase, digits, single dashes.

    validationseo
  • HTML tag

    /g
    </?[a-zA-Z][^>]*>

    Rough tag finder for quick audits. Use a parser for real HTML work.

    htmlscrape
  • Extra whitespace

    /g
    [ \t]{2,}

    Finds double spaces and stray tabs. Replace with a single space.

    cleanuptext
  • Hashtag

    /gu
    #[\p{L}\p{N}_]+

    Unicode-aware hashtag matcher for social text.

    socialunicode

How to use

  1. Type your pattern and toggle flags — matches highlight live.
  2. Read the token-by-token explanation to debug each symbol.
  3. Try a replacement, then grab a community pattern for common jobs.

FAQ

Is my pattern or test text uploaded anywhere?
No. Matching, replacement, and explanations run entirely in your browser with the built-in RegExp engine. Nothing ever leaves your device.
Which regex flavor is this?
JavaScript (ECMAScript) regex — the same engine browsers use. Lookbehind and named groups work in all modern browsers; \p{…} Unicode properties need the u flag.
Why does my pattern show an error?
The error message comes straight from the JavaScript engine — unclosed brackets, stray backslashes, or bad quantifiers like *+ are the usual causes. Fix the highlighted syntax and testing resumes instantly.
What do $1 and $& mean in the replacement?
$1, $2… insert capture groups, $& inserts the whole match, $$ inserts a literal dollar sign. Use the preview to verify before copying.
Are community patterns safe to use?
They are starting points for common jobs (emails, URLs, dates). Strict validation always needs extra checks — e.g. the IPv4 pattern matches 999.1.1.1, so pair it with a range check.

Related tools