JavaScript regex has its own syntax, its own Unicode behavior, and its own flag set, which is why a regex cheat sheet API alternative built only around ECMAScript RegExp is a safer reference than a generic, multi-dialect page. This tool is a curated, JavaScript-specific reference: it contains 44 entries across six fixed categories (characters, character classes, groups and references, quantifiers, assertions, and flags) with every row showing the category, exact token, concise meaning, and a JavaScript example. The search and category filter run entirely in the current browser tab, so no query, copied token, or selected category is uploaded anywhere, and the Copy button writes only the exact token from that row to your clipboard, not the slash delimiters, flags, or surrounding example. That makes it a practical regex cheat sheet API alternative for developers who want a fast local lookup that respects JavaScript's dialect boundary. It is deliberately scoped: the table describes ECMAScript regular expressions, not PCRE, Perl, Python, .NET, Java, RE2, POSIX, or any shell or editor-specific syntax.

regex cheat sheet api alternative
Regex Cheat Sheet API Alternative for JavaScript Tokens

Why JavaScript regex needs a dedicated reference

Regular expression engines look similar on the surface, but their token lists diverge in places that matter for working code. A pattern that compiles in one engine can be rejected by another, and tokens that look identical can carry different semantics around Unicode, lookarounds, or flags. The cheat sheet treats ECMAScript's RegExp pattern grammar as the normative source and cross-checks practical wording and examples against the MDN JavaScript regular expression syntax cheat sheet and the MDN RegExp reference. That is the core of its value as a regex cheat sheet API alternative: it never silently borrows syntax from another dialect.

For example, \d in JavaScript means the ASCII digits 0 through 9; it is not a shortcut for every Unicode decimal digit. Likewise, \w primarily covers ASCII letters, ASCII digits, and the underscore, with a documented Unicode-aware case-folding nuance only when the i and u flags are combined. To match Unicode properties such as Letter, you need a property escape like \p{Letter} with the u or v flag, and its complement is \P{Letter}. The cheat sheet states these distinctions rather than implying that property escapes work without Unicode-aware mode. The same boundary applies to lookbehind: JavaScript writes positive lookbehind as (?<=...) and negative lookbehind as (?

What 44 curated ECMAScript RegExp entries look like

The table is a fixed, curated reference: every entry has a category, an exact token, a concise meaning, and a JavaScript example, and tests enforce the table length, unique tokens, the exact category set, and twelve independently transcribed golden entries. The six categories, what they cover, and representative tokens are summarized below.

Category What it covers Example tokens
Characters Dot, ASCII digit and word escapes, whitespace escapes, Unicode property escapes ., \d, \w, \s, \p{Letter}
Character classes Listed, negated, and range classes [abc], [^abc], [a-z]
Groups and references Numbered captures, named captures, non-capturing groups, backreferences, alternation (x), (?<n>x), (?:x), \1, \k<n>, x|y
Quantifiers Greedy and lazy, exact, lower-bounded, bounded *, +, ?, {n}, {n,}, {n,m}, *?
Assertions Anchors, word boundaries, lookahead, lookbehind ^, $, \b, (?=x), (?!x), (?<=x), (?<!x)
Flags Per-match mode flags and their interaction rules g, i, m, s, u, v, d, y

The character section includes two-digit hexadecimal, four-digit UTF-16 code-unit, and braced Unicode code-point escape forms, with the braced code-point form requiring u or v. Examples are written as JavaScript regular-expression literals so the necessary slash delimiters and any flags remain visible, while the Copy button copies only the token shown in the Token column. That separation is what makes the row useful as a building block inside an existing pattern.

Find and copy a JavaScript regex token in three steps

Open the Regex Cheat Sheet in your browser tab and follow the steps below whenever you need to confirm a token's exact form, find a quick example, or pull one piece of syntax onto your clipboard.

  1. Enter a token or concept such as \d, lookbehind, Unicode, lazy, or named in the search field.
  2. Choose a category to narrow the JavaScript-specific entries, then review the token, meaning, and runnable-style example.
  3. Select Copy on one row to place only that exact RegExp token on the clipboard.

The search box accepts either a symbol or a concept, so searching \d finds the exact digit token, while terms such as lookbehind, Unicode, lazy, named, or line terminator find meanings and examples. Filters combine: the search and the category narrow the result set at the same time, and the displayed count always reports the complete number of matches with no hidden result cap. When nothing matches, the tool shows an explicit empty state instead of pretending a row exists. Changing the search or category invalidates an older clipboard job and clears its status, so a late clipboard response cannot describe a different filtered view.

What the Copy button actually puts on the clipboard

The Copy button is the part that distinguishes this tool from a static reference page. Each row's Copy button requests clipboard access for one token, and a job identifier ensures that only the newest copy attempt may publish success or failure, with component cleanup preventing a late clipboard promise from updating an unmounted page. What lands on the clipboard is exactly the token shown in the Token column for that row. The category label, meaning, slash delimiters, surrounding example, and any flags in the example are not copied.

That guarantee matters when you are building a pattern programmatically. If the example row shows /^([A-Z]\w*)\s+(\d+)/u, Copy places only [A-Z]\w* on the clipboard, leaving you free to insert it into an existing pattern, a template literal, or a new RegExp call without stripping delimiters or escaping slashes. Browser clipboard permission can still be denied; in that case the tool reports a recoverable error rather than claiming the token was copied. For the same reason, the cheat sheet is a quick syntax reference and not a regex validator, security analyzer, compatibility database, or guarantee that a pattern is efficient.

Browser-local processing and known limits

Search and filtering run entirely in the current browser tab. No query, selected category, copied token, or other input is uploaded to Lizely or another service, which is part of why the tool works as a regex cheat sheet API alternative for developers who prefer to keep pattern work local. The flag section lists d, g, i, m, s, u, v, and y, with explicit notes about behavior: s lets dot match line terminators, m changes how ^ and $ treat line boundaries, g enables global matching behavior and affects lastIndex in stateful operations, y requires a match at lastIndex, d exposes match indices, u enables Unicode-aware matching and code-point escapes, and v enables UnicodeSets behavior including class-set operations and properties of strings. The cheat sheet states that u and v cannot be combined on the same RegExp instead of suggesting that flags can always be mixed freely.

Even with a JavaScript-specific reference, runtime support is not uniform. When code will run in a particular browser, embedded runtime, or older Node.js version, also verify that environment's feature support. Test real patterns against representative inputs, avoid uncontrolled backtracking on untrusted text, and use the related Regex Tester when actual match behavior, capture groups, or named groups matter more than the token name. For complementary coverage of common JavaScript regex patterns, see the related JavaScript token reference guide for a broader pattern-framed angle on the same scope.

If you're weighing options, Separate Excel Sheets Into Different Windows and Files covers this in detail.