Regex Tester
Test a regular expression against sample text with live match highlighting, capture groups, a token-by-token explainer, a pass or fail test suite, ReDoS warnings and the real match time.
Runs entirely in your browser — nothing you paste is uploaded.
Regex cheat sheet
quick reference- \d \w \s .
- Digit, word character, whitespace, and any character except a newline. Upper case negates each one.
- ^ $ \b
- Start of input, end of input, and a word boundary — anchors match a position, not a character.
- * + ? {n,m}
- Zero or more, one or more, optional, and an explicit count or range of repetitions.
- ( ) (?: )
- A capture group records what it matched as $1, $2; a non-capturing group only groups without recording.
- (?=) (?!)
- Positive and negative lookahead: check what follows without consuming it.
- g i m s
- Global, case-insensitive, multi-line anchors, and dot-matches-newline flags.
Frequently asked questions
answered below the toolWhich regex engine does this use?
The browser's JavaScript engine, so lookbehind and named groups work, while PCRE-only syntax such as \A does not.
Why does my pattern match only the first result?
Without the g flag a pattern stops at the first match; add g to collect every match and to make the replace global.
What does a non-capturing group do?
(?:…) groups without recording a capture, so $1 still points at the group you need and the engine does less work.
Related Python syntax guides
All Python guidesasyncpg DuplicatePreparedStatement on PgBouncer and Supabase
asyncpg caches prepared statements per connection while a transaction pooler rotates connections underneath it. The cache setting, pool sizing and retry that fix it.
PythonPython Tabulate: Markdown Grid Headers and Alignment
Use Python's tabulate library to format Markdown tables, set custom headers, and control column alignment with pipe and grid formats.
PythonUsing pytest.mark.parametrize for Parameterized Tests in Python
Learn how to use pytest.mark.parametrize to write parameterized tests in Python. Covers syntax, multiple arguments, fixtures, custom IDs, class/module-level use, and common pitfalls.
PythonDjango select_related and prefetch_related: Fix N+1 Queries
Learn how to eliminate N+1 queries in Django with select_related and prefetch_related, including practical examples, when to use each, and common pitfalls.