tools/text/regex tester
// text

regex tester

live match highlighting, explain mode

/ /g
— enter a pattern // client-only
// matches appear here
// matches
— enter a pattern above
// reference
characters
digit 0–9
non-digit
word char
non-word
whitespace
non-whitespace
any (not \n)
newline
tab
anchors
line start
line end
word boundary
non-boundary
quantifiers
0+ greedy
1+ greedy
0 or 1
exactly n
n to m
0+ lazy
1+ lazy
groups & sets
capture
non-capture
lookahead
neg lookahead
char set
negated set
or

              curl -sX POST 'https://api.whittly.dev/v1/regex/test' \
  -H 'Authorization: Bearer $WHITTLY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"pattern":"\\d+","flags":"g","input":"order 42"}'
            

              const res = await fetch('https://api.whittly.dev/v1/regex/test', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + apiKey,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ pattern: "\\d+", flags: "g", input: "order 42" }),
});
const data = await res.json();
            

              const { data } = await axios.post(
  'https://api.whittly.dev/v1/regex/test',
  { pattern: "\\d+", flags: "g", input: "order 42" },
  { headers: { Authorization: 'Bearer ' + apiKey } }
);
            
// prosaved patternspro·history syncproupgrade →

// about this tool

A regular expression (regex) is a pattern that describes a set of strings. This tester lets you write a pattern, choose flags (global, case-insensitive, multiline, dot-all), and see every match highlighted in the test string in real time — including capture group values.

// when to use

  • Extract fields from log lines or CSV rows
  • Validate email addresses, phone numbers, or postal codes
  • Build search-and-replace patterns for a code editor
  • Test regex patterns before adding them to production code

// faq

What flags are supported?
g (global — find all matches), i (ignore case), m (multiline — ^ and $ match line boundaries), s (dot-all — . matches newlines). You can combine multiple flags.
Why does my regex cause the browser to freeze?
Some patterns cause catastrophic backtracking — exponential time complexity for certain inputs. Patterns like (a+)+ on a long non-matching string are common culprits. Simplify nested quantifiers or add a possessive quantifier if your engine supports it.
// history
Pro Cloud Sync — upgrade
no operations yet