My Tools Garage

Regex Cheatsheet

Searchable regex reference with a live tester.

in-browser

How to use

  1. 1 Browse the cheatsheet sections, or type in the filter to find a token fast.
  2. 2 Read each token’s meaning and example.
  3. 3 Scroll to the tester, enter a pattern and any flags (g, i, m, s, u).
  4. 4 Type a test string and review the highlighted matches; copy them if needed.

About Regex Cheatsheet

The Regex Cheatsheet is a fast, searchable reference for JavaScript regular-expression syntax, organised into the categories you actually reach for: character classes, anchors and boundaries, quantifiers, groups and alternation, lookaround, and flags.

Each entry pairs the token with a plain-language meaning and a tiny worked example, so you can recall what \b, (?:…), {n,m} or a lazy *? does without trawling through documentation.

Type into the filter box to narrow the sheet instantly — search by the token itself, by its description or by the example — and only the matching sections stay on screen.

When you want to confirm a pattern rather than just look it up, the built-in tester compiles your expression with whatever flags you supply and runs it against a sample string, listing every match.

Invalid patterns and bad flags surface a clear error instead of breaking the page.

Everything runs locally in your browser using the native RegExp engine, so nothing you type is sent anywhere and the page keeps working offline.

It is a handy companion whether you are writing a validation rule, debugging a stubborn capture group, or learning the syntax for the first time.

You can copy the list of matches with one click to drop into tests or notes.

FAQ

Which regex flavour does this cover?

It targets JavaScript regular expressions, which is what the live tester uses via the browser’s native RegExp engine. Most syntax also applies to other flavours.

Is my test data sent to a server?

No. The pattern, flags and sample text are evaluated entirely in your browser; nothing is uploaded or stored.

Why did my pattern show an error?

The expression failed to compile — usually an unbalanced bracket or an unsupported flag. The error message from the engine explains what went wrong.