Regex 101-02: Literal Matches


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).

CAT matches CAT

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

mOAR Regex

Leave a Reply

Your email address will not be published. Required fields are marked *