Skip to main content
Toollyz

Search tools

Search for a command to run...

Regex Generator

Pick from 25+ vetted patterns (email, URL, phone, UUID, IPv4, IPv6, ISO date, hex color…) or build one visually with character class, quantifier, anchors and flags. Live tester with match highlights.

What is the Regex Generator?

Regex Generator has two complementary surfaces. The library is 25+ curated, tested patterns covering the workhorse cases: email address (practical, not RFC 5322-perfect), URL (http/https), domain name (no protocol), IPv4 (strict 0-255 per octet), IPv6 (canonical 8-group), UUID v1-v8, MAC address, ISO 8601 date and datetime, US and international phone, hex color, CSS rgb()/rgba(), integer, decimal, currency, credit card, URL slug, username, strong password, HTML tag, markdown link, hashtag and mention. Each entry has a one-line description and a sample input that already contains matches so you can verify the regex right away. The visual builder lets you pick a character class (letters / digits / alnum / whitespace / word / any / custom), a quantifier (exactly one / one-or-more / zero-or-more / optional / exact N / between M and N), anchors (^ / $) and flags (g / i / m / s) — then it composes the regex AND writes a plain-English explanation of what it does. A live tester runs the active pattern against a test input and shows every match with its position and capture groups.

How to use it

  1. Browse the library by category (Common / Web / Identifiers / Numbers / Dates) or search.
  2. Or switch to Visual builder, pick a character class, quantifier and flags.
  3. Read the plain-English explanation of what your regex matches.
  4. Edit the pattern in the live tester, paste a test input, and verify the matches.

Benefits

  • 25+ curated patterns covering email, URL, phone, UUID, IPv4/IPv6, ISO dates and more.
  • Each library entry has a sample input that already contains matches — verify immediately.
  • Visual builder composes regex from character class + quantifier + anchors + flags.
  • Plain-English explanation generated alongside every built pattern.
  • Live tester runs the active pattern against your input with up to 50 highlighted matches.
  • Capture groups extracted and shown for each match.
  • Category filter + free-text search across the library.
  • Try/catch around the tester so a malformed pattern shows an error, not a crash.
  • Runs 100% in your browser — Toollyz has no server.

Frequently asked questions

How is this different from Regex Tester?

Regex Tester is for testing an existing pattern. This tool helps you CREATE the pattern in the first place — via the curated library or the visual builder — then you can test it too.

Why doesn't your email regex match every valid email?

RFC 5322 emails are absurdly permissive. Real-world deployments use a practical regex that covers ~99.9% of actual addresses. Our pattern allows the common forms (with + and . in the local part, ≥ 2-letter TLD) without false positives.

What does the visual builder actually do?

It composes one character class with one quantifier, optionally anchored, with chosen flags. It's deliberately simple — for multi-component regex (alternation, lookahead) use the library or write the pattern by hand.

Why no lookahead / lookbehind in the builder?

Lookahead and lookbehind have subtle gotchas and can produce hard-to-debug regex when composed visually. The library includes lookahead-based patterns (strong password) where they're genuinely useful.

What flags should I use?

g (global) is the default for 'find all'. i is case-insensitive. m treats `^` and `$` as start/end of LINE instead of string. s (dot-all) makes `.` match newlines too. u is for Unicode-aware matching.

Will my test input be saved?

Yes — locally. The pattern, flags and test input all persist in localStorage on this device for one-click resume.

Is my regex executed against arbitrary input?

Yes, but inside a try/catch with a 1000-match safety cap. A pathological 'catastrophic backtracking' regex might slow your browser but can't escape it.

Why does my regex say 'invalid'?

Most often: unescaped special characters ( ( [ { . ? * + | ^ $ \ ) or a flag set the engine doesn't recognise. The error message under the input gives the exact reason.

Can I get the regex in PCRE / Perl / Python flavour?

The patterns shown use JavaScript regex syntax (ECMAScript). Most patterns translate directly to PCRE / Perl / Python; the main differences are lookbehind (Python yes, JS yes since ES2018) and Unicode property escapes.

What's the difference between hex / colon-separated MAC formats?

We provide the colon/dash form. For Cisco dot-form (AABB.CCDD.EEFF) use the MAC Address Lookup tool — it accepts every form.

Is anything uploaded?

No. Pattern building and testing run entirely in your browser.