Regular expressions
Formal notation describing patterns of character sequences using metacharacters and operators. Regular expressions enable concise pattern matching in text processing and validation. Equivalent to finite state machines in expressive power. Different languages support variations in regex syntax.
Real World
When you sign up for Instagram, the app uses a regular expression like ^[a-zA-Z0-9._]{1,30}$ to check your username contains only valid characters and is under 30 characters long.
Exam Focus
Distinguish between * (zero or more) and + (one or more) — mixing these up is the most common lost mark.
How well did you know this?