Back
Close

Modern C++ idoms and recipes

meshell
57.5K views

Regular expressions

C++11 provides support for regular expressions within the standard library in the header regex through a set of classes, iterators, and algorithms. Regular expressions are used to perform pattern matching within strings.

Example

The following example checks if an input string represents a valid email address.

DIY

The example above verified a string by checking for a regex match. However the regex library allows also to search for matches and replace certain patterns. Try to solve the next exercise by using the right classes and algorithms from <regex> .

Implement the function according the documentation
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io