Exercise 31. Regular Expressions
Aregular expression (regex) is a succinct way to encode how a sequence of characters should be matched in a string. They are normally thought of as “scary” but, as you know, anything wrapped in fear is usually just taught wrong. The reality of regular expressions is they are a set of about eight symbols that tell a computer how to match a pattern. Used simply they are easy to understand. Where people run into trouble is trying to use incredibly complex regular expressions where an actual parser would be better. Once you understand these eight symbols and the limitations of regular expressions you’ll see they aren’t scary at all.
I’m going to have you do some more memorization to prime your brain for the discussion. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access