Back
Close

Modern C++ idoms and recipes

meshell
30.2K 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
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants