Test JavaScript regular expressions live, right in your browser
Regular expressions are a compact pattern language for describing shapes of text — an email address, a phone number, a repeated word, anything with a describable structure — rather than a single fixed string to search for. Every mainstream programming environment implements some dialect of the same idea, and JavaScript's own flavor (the one this page runs) is close enough to Python's, PHP's or Java's that a pattern worked out here usually carries over with only small adjustments.
A pattern is checked against text by an engine that tries every starting position until it finds one where the rules match, and the flags change how that search behaves: case sensitivity, whether it stops at the first hit or keeps going, and whether the dot also matches a line break. Parts of a pattern wrapped in parentheses become capture groups — pieces of the match that can be pulled out individually or referenced in a replacement, which is what makes regular expressions useful for reformatting text and not just for finding it.
Because a wrong pattern usually fails silently rather than raising an obvious error, testing one against real sample text before using it in actual code is standard practice — a pattern that looks correct can still match too much, too little, or the wrong part of a string. Everything here runs locally using the browser's own regular expression engine; nothing is uploaded anywhere.