Back to Dev Tools
utensil.dev

Regex Tester

Test regex patterns with multi-flavor support: JavaScript, Python, Go, Java, Rust, PCRE, .NET, Ruby.

Regex Flavor

ECMAScript (JavaScript)

JavaScript/TypeScript regex engine used in browsers and Node.js

Engine: V8/SpiderMonkey/JavaScriptCoreES2024

Pattern
//
Flags:

Common Patterns:

Test String
Results0 matches

Preview:

No matches

Quick Reference (ECMAScript)

Characters

  • . - Any character
  • \d - Digit [0-9]
  • \w - Word [a-zA-Z0-9_]
  • \s - Whitespace
  • \D, \W, \S - Negated

Quantifiers

  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • {n} - Exactly n
  • {n,m} - n to m times
  • *? - Lazy

Anchors & Boundaries

  • ^ - Start of line
  • $ - End of line
  • \b - Word boundary
  • \B - Non-word boundary
  • \A, \Z - String start/end

Groups & Lookaround

  • () - Capture group
  • (?:) - Non-capture
  • (?=) - Lookahead
  • (?!) - Neg. lookahead
  • (?<=) - Lookbehind
  • | - Alternation

Escape Rules for ECMAScript

  • Escape special chars: \ ^ $ . | ? * + ( ) [ ] { }
  • In character class: ] \ ^ - need escaping
  • Literal backslash requires \\