6. Regular Expressions
Note
Project: Validate a phone number using regular expressions.
Most introductory programming books don’t include an entire chapter on regular expressions because regular expressions can be intimidating. As a result, many programmers choose to never learn regular expressions. Although other tools can do much of what regular expressions can do, they don’t do the job as well. You can drive nails with the backside of a screwdriver, for example, but using a hammer is so much easier. For certain jobs, nothing but regular expressions work. Becoming comfortable with regular expressions early will benefit you as long as you program.
Having said that, I should mention that regular expressions are hard. They are terse and can ...
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