Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Regex / System / Text / RegularExpressions / RegexCapture.cs / 1 / RegexCapture.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
// Capture is just a location/length pair that indicates the
// location of a regular expression match. A single regexp
// search may return multiple Capture within each capturing
// RegexGroup.
namespace System.Text.RegularExpressions {
///
///
/// Represents the results from a single subexpression capture. The object represents
/// one substring for a single successful capture.
///
[ Serializable() ]
public class Capture {
internal String _text;
internal int _index;
internal int _length;
internal Capture(String text, int i, int l) {
_text = text;
_index = i;
_length = l;
}
/*
* The index of the beginning of the matched capture
*/
///
/// Returns the position in the original string where the first character of
/// captured substring was found.
///
public int Index {
get {
return _index;
}
}
/*
* The length of the matched capture
*/
///
///
/// Returns the length of the captured substring.
///
///
public int Length {
get {
return _length;
}
}
///
/// [To be supplied.]
///
public string Value {
get {
return _text.Substring(_index, _length);
}
}
/*
* The capture as a string
*/
///
///
/// Returns
/// the substring that was matched.
///
///
override public String ToString() {
return Value;
}
/*
* The original string
*/
internal String GetOriginalString() {
return _text;
}
/*
* The substring to the left of the capture
*/
internal String GetLeftSubstring() {
return _text.Substring(0, _index);
}
/*
* The substring to the right of the capture
*/
internal String GetRightSubstring() {
return _text.Substring(_index + _length, _text.Length - _index - _length);
}
#if DBG
internal virtual String Description() {
StringBuilder Sb = new StringBuilder();
Sb.Append("(I = ");
Sb.Append(_index);
Sb.Append(", L = ");
Sb.Append(_length);
Sb.Append("): ");
Sb.Append(_text, _index, _length);
return Sb.ToString();
}
#endif
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
// Capture is just a location/length pair that indicates the
// location of a regular expression match. A single regexp
// search may return multiple Capture within each capturing
// RegexGroup.
namespace System.Text.RegularExpressions {
///
///
/// Represents the results from a single subexpression capture. The object represents
/// one substring for a single successful capture.
///
[ Serializable() ]
public class Capture {
internal String _text;
internal int _index;
internal int _length;
internal Capture(String text, int i, int l) {
_text = text;
_index = i;
_length = l;
}
/*
* The index of the beginning of the matched capture
*/
///
/// Returns the position in the original string where the first character of
/// captured substring was found.
///
public int Index {
get {
return _index;
}
}
/*
* The length of the matched capture
*/
///
///
/// Returns the length of the captured substring.
///
///
public int Length {
get {
return _length;
}
}
///
/// [To be supplied.]
///
public string Value {
get {
return _text.Substring(_index, _length);
}
}
/*
* The capture as a string
*/
///
///
/// Returns
/// the substring that was matched.
///
///
override public String ToString() {
return Value;
}
/*
* The original string
*/
internal String GetOriginalString() {
return _text;
}
/*
* The substring to the left of the capture
*/
internal String GetLeftSubstring() {
return _text.Substring(0, _index);
}
/*
* The substring to the right of the capture
*/
internal String GetRightSubstring() {
return _text.Substring(_index + _length, _text.Length - _index - _length);
}
#if DBG
internal virtual String Description() {
StringBuilder Sb = new StringBuilder();
Sb.Append("(I = ");
Sb.Append(_index);
Sb.Append(", L = ");
Sb.Append(_length);
Sb.Append("): ");
Sb.Append(_text, _index, _length);
return Sb.ToString();
}
#endif
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventLogEntry.cs
- ErrorFormatter.cs
- GetCardDetailsRequest.cs
- CFStream.cs
- PathFigureCollectionConverter.cs
- HttpHandlerAction.cs
- BinHexEncoding.cs
- ThreadPool.cs
- CodeValidator.cs
- SecurityContext.cs
- EnumConverter.cs
- HttpBindingExtension.cs
- UInt64Storage.cs
- RootBrowserWindowProxy.cs
- ExpanderAutomationPeer.cs
- TextTabProperties.cs
- DefaultSection.cs
- QueryContext.cs
- PropagatorResult.cs
- EnumConverter.cs
- GeometryModel3D.cs
- SynchronizedRandom.cs
- SmtpDateTime.cs
- DrawingAttributeSerializer.cs
- RC2CryptoServiceProvider.cs
- Rect.cs
- GradientSpreadMethodValidation.cs
- ProxyWebPartManager.cs
- ResponseStream.cs
- TypedDataSourceCodeGenerator.cs
- DetailsViewActionList.cs
- ListViewItemMouseHoverEvent.cs
- LiteralControl.cs
- ChannelManager.cs
- ByteConverter.cs
- RichTextBox.cs
- WCFBuildProvider.cs
- DomainConstraint.cs
- LayoutTable.cs
- Binding.cs
- DataGridViewColumnHeaderCell.cs
- HttpApplication.cs
- ActivationArguments.cs
- RsaSecurityToken.cs
- TrackingMemoryStreamFactory.cs
- StringExpressionSet.cs
- SiteMapHierarchicalDataSourceView.cs
- XmlChoiceIdentifierAttribute.cs
- XmlDataSourceNodeDescriptor.cs
- Line.cs
- Icon.cs
- SetMemberBinder.cs
- FormViewCommandEventArgs.cs
- oledbmetadatacollectionnames.cs
- SByte.cs
- CellIdBoolean.cs
- TemplateControl.cs
- Scene3D.cs
- SudsWriter.cs
- WebConvert.cs
- SelectingProviderEventArgs.cs
- WorkflowInstanceContextProvider.cs
- ActiveDesignSurfaceEvent.cs
- CreateUserWizard.cs
- CacheOutputQuery.cs
- TableCell.cs
- ProvidePropertyAttribute.cs
- Themes.cs
- ConnectionConsumerAttribute.cs
- DataGridToolTip.cs
- DataContractSerializerMessageContractImporter.cs
- DrawingState.cs
- DefaultHttpHandler.cs
- BehaviorDragDropEventArgs.cs
- Menu.cs
- FontInfo.cs
- ProviderUtil.cs
- CompilerInfo.cs
- DefaultAsyncDataDispatcher.cs
- WebEventTraceProvider.cs
- __Error.cs
- ConnectionPoint.cs
- EntityClientCacheKey.cs
- FixedSOMGroup.cs
- WindowsFormsHelpers.cs
- TypefaceCollection.cs
- ObjectQuery.cs
- WorkItem.cs
- X509Certificate2Collection.cs
- LostFocusEventManager.cs
- SafeCryptoHandles.cs
- SqlDataSourceEnumerator.cs
- ReplyChannelBinder.cs
- FontFamily.cs
- SiteMapDataSourceDesigner.cs
- TypeLoadException.cs
- RootBuilder.cs
- ResetableIterator.cs
- EnterpriseServicesHelper.cs
- InternalUserCancelledException.cs