What does this pattern match?
Type a pattern and some text, and every match lights up as you type. Add a replacement to see what the result would be.
Questions people actually ask
- Which flavour of regex is this?
- JavaScript's, because it is your browser doing the matching. It is close enough to Perl and Python for almost everything, but lookbehind and named groups behave slightly differently in older engines, so check before copying a pattern into another language.
- How do I match across several lines?
- Add the "m" flag to make ^ and $ mean the start and end of each line, or "s" to let a dot match newlines too. Both go after the closing slash, as in /^total/gm.
- Why did it stop and say the pattern is too slow?
- Because some patterns take exponentially longer as the text grows — (a+)+b against a long run of a's is the classic. Left alone it would freeze the page, so it is stopped instead. The fix is nearly always to make a quantifier less greedy.
- Is my text sent anywhere?
- No. The matching runs in your browser, so you can safely test against real data instead of making up examples.