How to match the characters of a set 

When a set of character wants to be used, they should be used in brackets: [abc]. This regex matches only one of this set of characters. ^. could be used not to match any of the set of characters. [^abc]. matches any of the characters that are not a, b, or c. It is also possible to specify a range [0-9], [a-z] .This regex matches everything in the range. Instead of using [0-9], use the \d and, for [^0-9], this express, \D, can be used. 

Get R Web Scraping Quick Start Guide 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.