Free Tool

Regex Tester

Test regular expressions with real-time match highlighting. Free, instant.

//gm

Common regex patterns cheat sheet

PatternDescriptionExample Match
.Any character (except newline)a, 1, @
\dAny digit (0-9)3, 7
\wWord character (a-z, A-Z, 0-9, _)hello
\sWhitespace (space, tab, newline)(space)
^Start of string/lineStart
$End of string/lineend
[abc]Any of a, b, or ca
(a|b)a or b (capturing group)a
a{2,4}2 to 4 repetitions of aaaa
a+1 or more of aaaa
a*0 or more of a(empty), aaa
a?0 or 1 of a(empty), a

How to use the regex tester

  1. Enter your regular expression in the pattern field
  2. Toggle flags (global, case insensitive, multiline, dotall) as needed
  3. Enter or paste test text — matches highlight in real time
  4. View match details including index positions and capture groups

Frequently Asked Questions

What are regex flags?

Flags modify how the regex engine processes the pattern. The most common are:g (global — find all matches), i (case insensitive),m (multiline — ^ and $ match line boundaries), and s(dotall — . matches newlines).

Why is my regex not matching?

Common issues: forgetting the g flag (only finds first match), not escaping special characters like . or (, and not enabling the m flag when using ^ or $ with multiline text.

Need pattern-matched content optimization?

Quillly optimizes your blog content patterns for SEO automatically. Try it free.