Chapter 16. Regular Expression Objects

I du believe with all my soulIn the gret Press’s freedom,To pint the people to the goalAn’ in the traces lead ’em.

— “The Bigelow Papers”JAMES RUSSELL LOWELL

All the operations that involve regular expressions begin with an object of a type that is an instantiation of the class template basic_regex. This object holds the regular expression to be matched. It’s passed as an argument to the search functions (Chapter 17) and to the constructors of the regular expression iterators (Chapter 19).

The template takes two type arguments. The first, referred to as Elem in this chapter, is the type of the characters that the regular expression object will traffic in. The most common element types are, of course, char ...

Get The C++ Standard Library Extensions A Tutorial and Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.