December 2003
Intermediate to advanced
656 pages
13h 7m
English
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 ...
Read now
Unlock full access