Regex 101-02: Literal Matches

Example:

Literals aren’t very exciting and they are exactly as they sound. They match exactly as presented aka ‘literally‘.

NOTE: One thing to note is that once a match happens left to right and once it has been discovered it can no longer can be considered a match elsewhere. (It is consumed).

Example 1

CAT matches CAT

Example 2

22 matches 222, the left over 2 does not match because the 22 has already matched and 22 does not match 2

πŸ‘ Get Blog Updates

πŸ“ Latest Posts

0Shares
0

Leave a Reply