Regular expressions using Boost.Regex

When we write a line of code like boost::find_first("Where have all the flowers gone?", "flowers"), we are asking for the string "flowers" (call it the needle) to be found in the larger string "Where have all the flowers gone?" (call it the haystack). The needle is the pattern; seven specific characters in a particular order whose presence must be looked up in the haystack. Sometimes, however, we don't know the exact string we are looking for; we only have an abstract idea or a pattern in mind. Regular expressions is a powerful language to express this abstract pattern.

Regular expression syntax

Regular expressions are strings that encode a pattern of text using a mix of regular characters and some characters ...

Get Learning Boost C++ Libraries 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.