Branching: In most programming languages, we use if statements and switches. In regular expressions, we branch off using the | metasyntax character or using character sets. An | structure vaguely corresponds to an if-else structure, and a character set vaguely corresponds to a switch statement. An example of character sets is [ab]. Read it like a|b. In other words, choose either a or b.
5. Repeat Modifiers
Get Regex Quick Syntax Reference: Understanding and Using Regular Expressions now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.