Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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 { ////// [ 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 */ ////// Represents the results from a single subexpression capture. The object represents /// one substring for a single successful capture. ////// public int Index { get { return _index; } } /* * The length of the matched capture */ ///Returns the position in the original string where the first character of /// captured substring was found. ////// public int Length { get { return _length; } } ////// Returns the length of the captured substring. /// ////// public string Value { get { return _text.Substring(_index, _length); } } /* * The capture as a string */ ///[To be supplied.] ////// 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. //------------------------------------------------------------------------------ ///// Returns /// the substring that was matched. /// ///// 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 { ////// [ 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 */ ////// Represents the results from a single subexpression capture. The object represents /// one substring for a single successful capture. ////// public int Index { get { return _index; } } /* * The length of the matched capture */ ///Returns the position in the original string where the first character of /// captured substring was found. ////// public int Length { get { return _length; } } ////// Returns the length of the captured substring. /// ////// public string Value { get { return _text.Substring(_index, _length); } } /* * The capture as a string */ ///[To be supplied.] ////// 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./// Returns /// the substring that was matched. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AppearanceEditorPart.cs
- TableCellCollection.cs
- Geometry3D.cs
- DataDocumentXPathNavigator.cs
- ReflectionUtil.cs
- UriTemplateVariablePathSegment.cs
- DataGridSortCommandEventArgs.cs
- StatusCommandUI.cs
- BaseResourcesBuildProvider.cs
- ButtonBase.cs
- InteropEnvironment.cs
- StringInfo.cs
- DoubleLinkList.cs
- ThreadAttributes.cs
- AutomationPropertyInfo.cs
- Quad.cs
- OleDbRowUpdatedEvent.cs
- TextWriterTraceListener.cs
- cookieexception.cs
- ConstraintCollection.cs
- ResolveMatchesCD1.cs
- EventData.cs
- X509SecurityTokenProvider.cs
- storepermission.cs
- EditingScope.cs
- FontClient.cs
- DataListItem.cs
- CodeTypeMember.cs
- DataGridViewButtonColumn.cs
- XmlQueryContext.cs
- ImageDrawing.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DataRelationPropertyDescriptor.cs
- ColorContext.cs
- Journaling.cs
- ProxyWebPartConnectionCollection.cs
- BinHexEncoding.cs
- TrackingServices.cs
- GridViewUpdatedEventArgs.cs
- DataContractSerializer.cs
- DecryptedHeader.cs
- SchemaImporterExtensionElementCollection.cs
- CornerRadiusConverter.cs
- CompleteWizardStep.cs
- SharedPersonalizationStateInfo.cs
- ContentElementAutomationPeer.cs
- ComboBoxAutomationPeer.cs
- BuildResult.cs
- FloatUtil.cs
- XmlEncodedRawTextWriter.cs
- TextParaLineResult.cs
- MainMenu.cs
- NativeMethodsCLR.cs
- WindowsToolbarItemAsMenuItem.cs
- XamlSerializerUtil.cs
- ChildDocumentBlock.cs
- WebEvents.cs
- EnvironmentPermission.cs
- DataBindingHandlerAttribute.cs
- BounceEase.cs
- StrokeNodeOperations.cs
- Expander.cs
- ChildTable.cs
- SafeCryptoKeyHandle.cs
- CodeTypeOfExpression.cs
- Random.cs
- FileEnumerator.cs
- ContentElement.cs
- MarkupCompiler.cs
- HtmlShimManager.cs
- COM2Enum.cs
- FocusManager.cs
- OdbcErrorCollection.cs
- Resources.Designer.cs
- MemberInfoSerializationHolder.cs
- NullableDoubleMinMaxAggregationOperator.cs
- DataException.cs
- RTLAwareMessageBox.cs
- BuilderElements.cs
- QilFactory.cs
- FixedHighlight.cs
- XmlChildNodes.cs
- IsolatedStorageFilePermission.cs
- WeakRefEnumerator.cs
- Configuration.cs
- PerfService.cs
- IISUnsafeMethods.cs
- Mappings.cs
- DetailsViewDeleteEventArgs.cs
- GetPageNumberCompletedEventArgs.cs
- RefType.cs
- RuntimeIdentifierPropertyAttribute.cs
- KnownTypes.cs
- ScrollProviderWrapper.cs
- PropertyToken.cs
- QuarticEase.cs
- HwndSubclass.cs
- PenCursorManager.cs
- WebBrowser.cs
- OleDbParameter.cs