O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

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

Name

Capture

Synopsis

This class represents a single result from a capturing group, which is a segment of a regular expression that is delineated, usually by parentheses. The parentheses signal .NET’s regular expression engine to save that segment’s result for later use. Capture objects compose the collection returned by Group.Captures. The Value property gets the captured substring. The Index property contains the starting position of the capture in the input string, while Length contains the length of the captured string.

public class Capture {
// Public Instance Properties
   public field int Index{get; } 
   public field int Length{get; } 
   public field string Value{get; } 
// Public Instance Methods
   public override method string ToString();                     // overrides object
}

Subclasses

Group

Returned By

CaptureCollection.this

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