ToolBuddy
In Browser

Regex Tester

Test JavaScript regular expressions in the browser. Paste a pattern and a string, toggle flags, see highlighted matches and capture groups, then copy matches or a replace result. Patterns never leave the tab.

Runs in your browser. Nothing is uploaded.

Loading tool…

About this tool

Test JavaScript regular expressions locally. Toggle g, i, m, s, u, and y, highlight matches in the haystack, and list capture groups. Optional replace uses the same flags and String.replace rules, including $1 backreferences.

How to use: enter a pattern, pick flags, paste a test string. Scan the preview, then copy match lines from the sticky bar. Switch output to Replace when you want a rewritten string. Invalid patterns show the engine error instead of a blank pane.

Example: /\b\w+ain\b/gi against The rain in Spain stays mainly in the plain. yields rain, Spain, and plain. A zero-width match is highlighted and does not freeze the tab; results cap at 500 matches.

Patterns and test strings stay in the tab. This is the JavaScript RegExp engine, not PCRE or Python re. After load, testing works offline. Related: URL encoder if you needed to escape a pattern for a query string.

FAQ

Related Web tools