Skip to content
Menu
Free · Private · No Sign-up

The regex tester that explains, lints, and ships code with you.

Running without a background worker (this page was opened directly rather than served over http/https), so matching runs on the main thread and the catastrophic-pattern timeout is unavailable. Serve this folder with a local web server for full protection.
Did you mean ?

      Supports native replacement syntax: $1, $<name>, $&, $`, $'.

      Static analysis of your pattern — catches common mistakes and performance footguns, with one-click fixes where it's safe to apply one automatically.

      Ready-to-paste snippets for the pattern above, in six languages — flags and replacement syntax are translated per language.

      Give a few strings that should match and (optionally) a few that shouldn't — this builds a best-effort pattern from them. It's a heuristic, not a guaranteed-general solution, so always check the results below and try it in the Matches tab.

      Click any card to load it straight into the tester, with a matching sample test string.

      Anchors

      ^Start of string / line
      $End of string / line
      \bWord boundary
      \BNot a word boundary

      Character classes

      .Any character except line break
      \d \DDigit / non-digit
      \w \WWord / non-word character
      \s \SWhitespace / non-whitespace
      [abc]Any of a, b, or c
      [^abc]Any character except a, b, c
      [a-z]Any character in the range a–z

      Quantifiers

      *0 or more
      +1 or more
      ?0 or 1 (optional)
      {n}Exactly n times
      {n,}n or more times
      {n,m}Between n and m times
      *? +?Lazy (as few as possible)

      Groups & alternation

      (...)Capturing group
      (?:...)Non-capturing group
      (?<name>...)Named capturing group
      a|ba OR b
      \1 \k<name>Backreference

      Lookaround

      (?=...)Positive lookahead
      (?!...)Negative lookahead
      (?<=...)Positive lookbehind
      (?<!...)Negative lookbehind

      Flags

      gGlobal — find all matches
      iCase-insensitive
      mMultiline
      sDot matches newline
      uUnicode mode
      ySticky