Chapter 21. Customizing Regular Expressions

“When I use a word,” Humpty Dumpty said, in rather a scornful tone, “it means just what I choose it to mean—neither more nor less.”

Through the Looking-GlassLEWIS CARROLL

In Chapter 16, we saw that the template basic_regex<Elem> has a second template argument, with a default type regex_traits<Elem>. In this chapter, we look at that parameter in more detail. As a reminder, the declaration of basic_regex looks like this:

    // CLASS TEMPLATE basic_regextemplate <class Elem,    class RXtraits = regex_traits <Elem> >    class basic_regex;

Each basic_regex object contains an object of type RXtraits, which determines how the basic_regex object interprets some features of the regular expression grammar. ...

Get The C++ Standard Library Extensions A Tutorial and Reference 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.