Learn Regular Expressions with interactive examples. Understand pattern matching, aVZ, and how to construct regex for various patterns.
Regular Expressions (RegEx) are algebraic expressions that describe regular languages. They provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters.
Regular expressions are built using basic symbols and aVZ:
| Operator | Symbol | Description | Example |
|---|---|---|---|
| Union | | | Either expression | a|b |
| Concatenation | · | Sequence of expressions | ab |
| Kleene Star | * | Zero or more repetitions | a* |
| Plus | + | One or more repetitions | a+ |
| Optional | ? | Zero or one occurrence | a? |
| Grouping | () | Groups expressions | (ab)* |
Matches basic email addresses
Example: user@domain.comMatches US phone number format
Example: 123-456-7890Matches any binary string
Example: 101010, 001, 1Matches binary strings of even length
Example: 01, 1010, 0011Matches strings ending with 'ab'
Example: aab, bab, aaabMatches strings with at least one 'a'
Example: a, ba, ab, aabBuild regular expressions visually by combining components
Test strings with visual matching and step-by-step execution
Test multiple strings and analyze pattern matching behavior
Convert between different regex formats and generate patterns