How to match a single character 

It is possible to define and use regular expressions with every programming language. Although the use of regular expressions between programming languages is somewhat different, it is often the same.

The dot (.) is used for matching any of characters. When dot is used as a character, the escape character should be used: \. A question mark (?) is used for defining that the preceding character is optional. When it needs to be used as a question mark, an escape character should 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.