Developer tools
Test regular expressions locally with capture groups and code examples.
const regex = new RegExp("\\b(\\w+)\\b", "g");
const match = regex.exec(text);Matching runs in JavaScript. PHP uses PCRE; syntax and supported flags can differ.
preg_match_all('~\\b(\\w+)\\b~', $text, $matches, PREG_OFFSET_CAPTURE);Enter a JavaScript pattern without delimiters, flags and test text. Matches and capture groups update automatically.
Use (hello) with flag g against hello world.
Execution runs in a worker terminated after 750 ms. Results are capped at 500 matches. PHP examples require PCRE compatibility review.