Test regular expressions with real-time match highlighting. View all matches, capture groups, and match positions. Browse 25+ common patterns ready to load.
A regular expression is a sequence of characters that defines a search pattern. Used for string matching, validation, parsing, and text manipulation. In JavaScript, regex patterns are written between forward slashes: /pattern/flags. Common metacharacters include . (any char), * (zero or more), + (one or more), ? (zero or one), and ^/$ (line boundaries).
g (global) finds all matches, not just the first. i makes the match case-insensitive. m makes ^ and $ match line starts/ends rather than string start/end. s makes . match newlines too. u enables full Unicode support for patterns like \p{Letter}.
Parentheses () create capture groups that let you extract sub-parts of a match. For example, (\d{4})-(\d{2})-(\d{2}) applied to 2024-01-15 captures three groups: year, month, and day. Named groups use syntax like (?<year>\d{4}). Non-capturing groups use (?:).
By default, quantifiers like + and * are greedy — they match as much as possible. Adding ? makes them lazy: they match as little as possible. For example, <.+> on <a><b> matches the whole string, while <.+?> matches just <a>.
Our API applies regex patterns to text at scale — batch process thousands of strings, extract data, validate inputs, and get structured JSON results.
View API Docs →