I Need My \s

We have improved our patterns a lot from the first regular expression we wrote (/Steven/), and we haven’t even gotten into one of the most prolific features regular expressions have to offer: the backslash. So far, we’ve used the backslash as an escape character, a way to take the super powers away from a special character. But the backslash doesn’t just take; the backslash can give super powers to ordinary characters, too.

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.