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

Processing Groups and Captures

So far you've seen how to split strings and parse strings based on supplied patterns with specialized (meta-) characters. Now you'll take what you've learned a step further and discover the world of groups and captures. However, before we get into the technical details of how to work programmatically with groups and captures, let's cover what they are and what services they provide.

Grouping has two purposes. One is to designate captures—to specify a smaller part of a larger match that contains a string that you wish to extract or isolate. In this vein, groups can be thought of as “sub-matches.” An example of this would be in working with strings containing U.S. telephone numbers. Groups would come into play in ...

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