Skip to content
yutils
Example

Pattern + test input

Pattern: \b[\w.+-]+@[\w-]+\.[\w.-]+\b
Flags: g
Test: Contact hello@yutils.dev or sales+korea@yutils.dev for inquiries.

Match result

2 matches
- hello@yutils.dev (pos 8, len 16)
- sales+korea@yutils.dev (pos 28, len 22)

Note

Without the g flag only the first match is shown. Capture groups also appear as $1, $2 indexed sub-results.

Usage / FAQ

When to use

  • Validate email / URL / phone number extraction patterns
  • Test JavaScript RegExp behavior exactly (no engine differences)
  • Inspect capture groups — $1, $2 ... indexed in results
  • Toggle g flag for all matches, i for case-insensitive
  • Debug regex by spotting match position and length

FAQ

Q.Is this compatible with Python / Java / PHP regex?
A.Engines differ. This tool uses JavaScript RegExp — lookbehind, named groups behave differently across languages. For cross-language compatibility, check a PCRE-compatible tool separately.
Q.My pattern hangs (catastrophic backtracking)
A.Nested repetition like `(a+)+` or wide alternation triggers backtracking explosion. JS lacks atomic groups — redesign or use possessive quantifiers where supported.
Q.Capture vs non-capturing group?
A.Use `(?:...)` for grouping without capture. Avoid `(...)` when you don't need the match — saves memory and slight perf.
Fun facts
  • The mathematical foundation of regular expressions comes from Stephen Kleene in 1956. The asterisk in `a*` (Kleene star) is literally named after him — "a repeated zero or more times". This was decades before "regex" became a thing, and before computers were widely available.

    Wikipedia — Stephen Kleene
  • Jamie Zawinski's famous quote: "Some people, when confronted with a problem, think 'I know, I'll use regular expressions.' Now they have two problems." It was a joke from 1997, but Stack Overflow and Twitter still quote it weekly.

    Wikipedia — Zawinski
  • Regex engines are not a single thing — POSIX BRE, POSIX ERE, PCRE, Perl, Python `re`, JavaScript RegExp, and more. Support for lookbehind, named groups, atomic groups, etc. differs across engines. This tool uses JavaScript RegExp, so results may diverge from Python regex on edge cases.

    Wikipedia — Regex standards