O'Reilly logo

Boost C++ Application Development Cookbook by Antony Polukhin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Matching strings using regular expressions

Let's do something useful! It's common that the user's input must be checked using some regular expression-specific pattern that provides a flexible means of match. The problem is that there are a lot of regex syntaxes; expressions written using one syntax are not handled well by the other syntax. Another problem is that long regexes are not easy to write.

So in this recipe, we'll write a program that may use different types of regular expression syntaxes and checks that the input strings match the specified regexes.

Getting ready

This recipe requires basic knowledge of STL. Knowledge of regular expression syntax can be helpful, but it is not really required.

Linking examples against the libboost_regex library ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required