Regex Tester

Test JavaScript regular expressions in real time, inspect matches and groups, run multiple cases, and understand syntax—all locally in your browser.

Private by default. Your patterns and test text stay in this browser.

Test cases

FAIL
FAIL

Pattern explanation

JavaScript regex cheatsheet

^ $ anchors · \d \w \s classes · * + ? quantifiers · () captures · | alternatives

How to test a regular expression

Use this tester to check JavaScript patterns before you add them to a form, validator, search, or replacement flow. It runs locally and does not send your pattern or sample text to ToolkitLoop.

Write a pattern

Enter the expression without slash delimiters, then choose JavaScript flags such as i or g.

Check real examples

Paste representative text and inspect every match, capture group, and named group.

Try edge cases

Add independent cases with an expected result before using the pattern in your code.

When to use a regex tester

When to use a regex tester

Check a form rule

Try representative valid and invalid values before using a JavaScript pattern in a form or validator. Keep separate cases for expected matches and non-matches.

Inspect a search or replacement

Paste realistic text to see every match and capture group. Add replacement text only when you want to review the resulting output.

Review a shared pattern

Test a pattern copied from a codebase, issue, or AI output against examples you understand. The tool highlights possible risk but does not claim to prove safety.

Patterns and flags work together

Patterns and flags work together

A JavaScript regex pattern describes what to match. Flags change how that pattern is interpreted or applied to input: for example, i ignores case, g searches globally, m changes line-boundary behavior, and s lets . match line terminators.

Regex Tester FAQ

Testing a pattern

How do I test a regex online?

Enter a JavaScript pattern, flags, and test input to inspect matches locally.

How can I test one regex against multiple strings?

Add independent test cases and choose whether each should match.

Flags, privacy, and safety

What do flags mean?

Flags change JavaScript behavior, such as case-insensitive matching with i or global matching with g.

Is my test data private?

Yes. Your pattern and input stay in your browser.

How do I avoid catastrophic backtracking?

Avoid nested ambiguous quantifiers. The tool warns about possible risk but cannot prove a pattern safe.