Free, privacy-first

Regex Cheat Sheet

Last updated:

Browse common JavaScript regex tokens, group types, flags, and examples without leaving the browser.

Runs locally in your browser. No data leaves your device.

What this tool helps you answer

What this tool helps you answer

Filter a JavaScript regex reference by topic or search term so you can recall tokens, meanings, and examples quickly.

Input values

Results

Next step

Explore the next step

Use this page when you remember roughly what regex feature you need but want a fast JavaScript-focused reference before you write or debug the pattern.

Editorial review

How this page was built

This page combines the live tool, input guidance, worked examples, and operating limits so Regex Cheat Sheet stays useful even before users interact with the calculator.

Reviewed by Klartext Tools against the current Regex Cheat Sheet workflow on 2026-03-12.

Last updated:

Use with judgment

Assumptions

  • Regex Cheat Sheet is strongest when you keep the scenario narrow and compare the result against a second plausible case.
  • Re-check the input scope, units, and exclusions before acting on the result.
  • Run a second scenario when one assumption could materially change the recommendation.
  • Treat this page as planning support, not as a substitute for supplier, legal, medical, or licensed professional advice.

Page scope

What this page covers

  • How to Use This Regex Cheat Sheet
  • Sample inputs and scenarios
  • Use Cases
  • Best practices
  • Why this matters
  • What this tool does

Worked examples

Find lookbehind syntax

Jump directly to the lookaround section when you remember the idea but not the exact token.

Topic
Lookarounds
Search
lookbehind

Filters the table to the positive and negative lookbehind entries.

Review regex flags

Show the JavaScript flag entries only when you need a quick refresher on g, i, m, s, or u.

Topic
Flags

Displays the flag reference rows with examples.

How to Use This Regex Cheat Sheet

Use the cheat sheet when you need a quick JavaScript regex reference instead of a full tutorial.

  1. Choose a topic or keep all topics

    Narrow the table to the concept area you need, or keep everything visible for a broad reference.

  2. Search for the token or example you remember

    The filter checks token, meaning, and example text so partial memory is usually enough.

  3. Read the meaning and example together

    Do not rely on the token alone. The example usually makes the syntax choice much clearer.

  4. Switch to the tester or explain tool next

    Once the syntax is clear, validate the full regex on sample input or inspect a more complex pattern in the explain view.

Sample inputs and scenarios

These shortcuts jump straight to common reference lookups.

Find lookbehind syntax

Jump directly to the lookaround section when you remember the idea but not the exact token.

Sample inputs

Topic
Lookarounds
Search
lookbehind

Sample outcome: Filters the table to the positive and negative lookbehind entries.

Review regex flags

Show the JavaScript flag entries only when you need a quick refresher on g, i, m, s, or u.

Sample inputs

Topic
Flags

Sample outcome: Displays the flag reference rows with examples.

Why this matters

A cheat sheet is only useful if it maps tokens to meaning quickly. This page keeps the focus on JavaScript regex syntax so you can move from memory refresh to working pattern without paging through generic docs.

Best practices

  • Test against both valid and invalid examples to confirm the pattern rejects what it should.
  • Use named capture groups in complex patterns to keep extraction logic readable and maintainable.
  • Prefer anchors (^ and $) for full-string matching: without them, patterns match substrings silently.

Use Cases

  • Validate data formats quickly while debugging APIs and integrations.
  • Clean up code, regex, and schedules before deployment or review.
  • Reduce context-switching by running diagnostics directly in the browser.

Continue with guides, comparisons, and nearby tools

Tools & topics

Reviewed by Klartext Tools

  • Reviewed with the Klartext Tools editorial process for practical browser-based workflows.
  • Assumptions and limitations are stated directly on the page before the decision-support sections.
  • Worked examples and FAQs are included so the result can be checked against a second scenario.

Frequently Asked Questions

Which regex engine is used?
The browser JavaScript RegExp engine. Patterns that work here will behave consistently in any browser-side JavaScript but may need adjustment for server-side engines like Python re or PCRE.
Can I test multiline input?
Yes, include the m flag when needed. The m flag makes ^ and $ match line starts and ends; use the s flag to make . match newlines across entire blocks.
How reliable are the calculated results in this tool?
The result is calculated directly from the values you enter. If the inputs are off, or the real situation differs from the model, the output will drift too. Use it as a solid estimate, then sanity-check it against the specifics of your project when the decision matters.
Are my inputs saved or sent to a server?
Calculations run locally in your browser session for immediate feedback, and no manual form submission is required. If you use export actions, files are generated and downloaded on your device. For sensitive workflows, you can still clear the form and browser data after use.
What input mistakes most often lead to misleading results?
The most common issues are unit mismatches, unrealistic defaults left unchanged, and incomplete boundary conditions. Double-check decimal separators, percentages versus absolute values, and the selected mode or profile before calculating. If results look unexpected, run a second scenario with conservative values to verify sensitivity.
What does Regex Cheat Sheet calculate compared with a basic regex cheat sheet online?
Regex Cheat Sheet focuses on browse common JavaScript regex tokens, group types, flags, and examples without leaving the browser. It is built for online developer tools & utilities workflows and returns reproducible results for the same inputs.
Which inputs affect regex cheat sheet results the most?
Start with Topic, Search. Small changes in those fields usually drive the biggest output shift, so compare at least two scenarios before deciding.
Is regex cheat sheet free useful for quick scenario planning?
Yes. Regex Cheat Sheet is designed for fast what-if analysis, letting you test assumptions and compare outcomes directly in your browser session.

Cross-Category Recommendations

If the job spills into another category, these tools help with the next step.