Pattern tools
Regex Tester
Test JavaScript regular expressions against text locally, with match positions and groups.
Runs locallyRuns locally in your browser
Text: up to 1 MB. Pattern: up to 10 KB. Up to 1,000 matches and 2 MB output. One-second timeout.
Guide
Test a regular expression against sample text and inspect the matches and captured groups. Use the flags to change how the pattern matches, then run the test to see which parts of the text it finds.
- Add your input
Enter Pattern and Flags, then type Test text or choose an example. Open file reads one local UTF-8 file.
- Read the result
Choose Test to see matches, positions and captured groups. Positions count UTF-16 units from zero. A limited result says truncated: true.
- Keep your work
Use Copy output or Download above the fields. Changing inputs clears the previous result.
See how two flags interact
With pattern cat and text Cat cat, g finds the lowercase match. Add i to use gi and both words match. Choose Test after changing the flags.
On mobile, choose the result tab to read the result. Clear removes your document and result.
Flags
- g — find all matches, rather than only the first.
- i — ignore uppercase and lowercase differences.
- m — let ^ and $ match each line's start and end.
- s — let . also match line breaks.
- u — interpret the pattern as Unicode.
- y — match only at the current position (initially the start).
- Combine letters, for example gi. Leave empty for default matching.
Pattern
- Pattern: enter the expression itself, without surrounding / characters or trailing flags. Put flags in the separate Flags field.
Shortcuts
- Ctrl / Cmd + Enter — Run selected action
- Ctrl / Cmd + Shift + C — Copy output
- Ctrl / Cmd + S — Download output
- ? — Show shortcuts outside text fields
Shortcuts work while focus is in the workspace. Copy and download need valid output.
Common questions
- Can I use this offline?
- After Available offline appears, this tool can process new local input without a network connection. App files are cached, never your document.
- Is my input uploaded?
- No. Processing happens in this browser. Files and results are not saved between visits.
- What are the limits?
- Text up to 1 MB, pattern up to 10 KB, 1,000 matches and 2 MB output. Processing stops after one second; simplify a slow pattern.
Was this tool helpful?
Only your rating and optional feedback are sent. Your tool input and output are never included.