Test regular expressions with live matching, capture groups, and common pattern library.
Test regular expressions with live matching and group extraction
Regular expressions are powerful tools for pattern matching and text processing. They are supported in virtually all programming languages and are essential for tasks like form validation, data extraction, and search/replace operations.
. - Any single character (except newline)* - Zero or more of the preceding element+ - One or more of the preceding element? - Zero or one of the preceding element^ - Start of string/line$ - End of string/line\d - Any digit (0-9)\w - Any word character (a-z, A-Z, 0-9, _)\s - Any whitespace characterA regular expression (regex) is a sequence of characters that defines a search pattern. It is used for pattern matching, validation, and text manipulation in programming.
g = Global (find all matches), i = Case insensitive, m = Multiline (^ and $ match line boundaries), s = DotAll (. matches newlines), u = Unicode support.
Capture groups are portions of the pattern enclosed in parentheses (). They allow you to extract specific parts of a match. Named groups use the syntax (?<name>pattern).
Use a backslash (\) before special characters like . * + ? ^ $ { } [ ] ( ) | \ to match them literally.