O'Reilly logo

Extending MFC Applications with the .NET Framework by Nishant Sivakumar, Tom Archer

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

Searching Strings with the Match and MatchCollection Classes

The Match class encapsulates information about a Regular Expressions pattern match—including a property to determine if the match was successful, the relative index into the string where the pattern was found (matched), and the matched value. This works by simply constructing a Regex object with the desired pattern and then calling the Regex class's Match method to return a Match object. The success or failure of the match can then be determined by evaluating the Match::Success Boolean property. For situations where a pattern might yield multiple matches, a collection object of type MatchCollection can be acquired via a call to the Regex::Matches method. As you might suspect, the

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