Regular Expression Syntax
Regular Expression Syntax
Anchors
Anchors specify positions in the input text.
2. Character Classes
Character classes match specific sets of characters.
[abc] Matches any one of the characters a, b, or [aeiou] matches any vowel.
c.
4. Quantifiers
Quantifiers specify the number of occurrences for a match.
(abc) Matches and captures the group "abc". (abc)+ matches "abcabc".
(?!abc Negative lookahead (matches if "abc" does not a(?!b) matches "a" in
) follow). "ac".
(?<!ab Negative lookbehind (matches if "abc" does not (?<!a)b matches "b" in
c) precede). "cb".
7. Special Sequences
Special sequences simplify certain tasks.