Regular expression tester

Test JavaScript regular expressions against sample text in real time.

Runs on your deviceFreeNo account

How to use Regex tester

Enter a pattern without slashes, set flags (g, i, m, s, u), and paste test text. Matches highlight in the sample. Use this to debug validators, search-and-replace, and log parsers. JavaScript regex syntax only.

Write a pattern, toggle flags, and see matches highlighted. Groups are listed under the sample. Invalid patterns show the engine error instead of failing silently.

Also searched as regex tester, regular expression, regexp. All processing for this tool happens in your tab unless labeled otherwise.

Questions

PCRE vs JavaScript?

This is the browser’s JS engine. Lookbehind works in modern browsers; some PCRE verbs do not.

Catastrophic backtracking?

Evil patterns can freeze the tab. Keep tests small while experimenting.

Replace?

A replace field shows the substitution result with captured groups.

Related tools

More text & code people open next.