Regular expression tester
Test a JavaScript regular expression against sample text in your browser: live match highlighting, capture groups, flags and a replacement preview.
Notes
- This uses the JavaScript engine in your browser, so the syntax is exactly what
new RegExp(pattern, flags)accepts. Other languages differ in details (lookbehind support,\dand Unicode digits, named-group syntax). - Matching runs on your machine. A pattern with nested quantifiers such as
(a+)+$against a long non-matching string can take exponential time; if the page stops responding, close the tab. - Without the
gflag only the first match is reported, which is also howString.prototype.matchbehaves.
Learn the syntax in Regular expressions, the useful 20%.