Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Regex / System / Text / RegularExpressions / RegexCapture.cs / 1305376 / 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 { ////// #if !SILVERLIGHT [ Serializable() ] #endif 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 { ////// #if !SILVERLIGHT [ Serializable() ] #endif 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
- MailWebEventProvider.cs
- XPathParser.cs
- SystemWebCachingSectionGroup.cs
- BinHexDecoder.cs
- CustomLineCap.cs
- XPathPatternBuilder.cs
- ServicePointManagerElement.cs
- Models.cs
- XamlHostingConfiguration.cs
- TreeNodeClickEventArgs.cs
- NotifyParentPropertyAttribute.cs
- PrintPreviewDialog.cs
- InlineUIContainer.cs
- Int16AnimationUsingKeyFrames.cs
- uribuilder.cs
- ToolboxComponentsCreatedEventArgs.cs
- GridViewDeletedEventArgs.cs
- NameObjectCollectionBase.cs
- ErrorEventArgs.cs
- MailMessage.cs
- WebExceptionStatus.cs
- ValidationHelper.cs
- StackOverflowException.cs
- OrderByBuilder.cs
- BitmapCache.cs
- QueryRewriter.cs
- SoapHeaderException.cs
- documentsequencetextcontainer.cs
- ScalarConstant.cs
- ObjectQueryProvider.cs
- EntityReference.cs
- MultilineStringConverter.cs
- XmlObjectSerializerWriteContext.cs
- NavigationService.cs
- SettingsPropertyCollection.cs
- LazyTextWriterCreator.cs
- NameTable.cs
- RegexMatchCollection.cs
- Utils.cs
- DeclaredTypeElement.cs
- BamlRecordHelper.cs
- SchemaCollectionPreprocessor.cs
- ExpressionsCollectionConverter.cs
- COAUTHIDENTITY.cs
- FaultFormatter.cs
- ValidationErrorCollection.cs
- HtmlElementCollection.cs
- PanelStyle.cs
- DesignTimeTemplateParser.cs
- Int32KeyFrameCollection.cs
- UserNamePasswordValidator.cs
- DeadCharTextComposition.cs
- DeclarationUpdate.cs
- HostVisual.cs
- Control.cs
- CodeValidator.cs
- SafeArrayTypeMismatchException.cs
- IPipelineRuntime.cs
- EntityDataReader.cs
- AttachInfo.cs
- DataBoundLiteralControl.cs
- EditorPartDesigner.cs
- RecognizerStateChangedEventArgs.cs
- StrongNameKeyPair.cs
- BigInt.cs
- WebPartManagerInternals.cs
- Assembly.cs
- GPStream.cs
- TextTreeRootTextBlock.cs
- DependencyObjectValidator.cs
- DynamicFilter.cs
- SecurityKeyIdentifier.cs
- FrameworkContextData.cs
- InputScopeAttribute.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ExpressionBuilderCollection.cs
- DesignerSerializationOptionsAttribute.cs
- Attributes.cs
- OrderPreservingPipeliningMergeHelper.cs
- NonBatchDirectoryCompiler.cs
- DataControlPagerLinkButton.cs
- PageMediaType.cs
- SamlDoNotCacheCondition.cs
- EpmContentDeSerializer.cs
- PathTooLongException.cs
- ObjectAnimationBase.cs
- SqlConnectionHelper.cs
- RelationshipEndMember.cs
- Permission.cs
- IdentityVerifier.cs
- VSWCFServiceContractGenerator.cs
- UnSafeCharBuffer.cs
- SourceItem.cs
- GlyphRunDrawing.cs
- _PooledStream.cs
- ConfigurationSchemaErrors.cs
- Rule.cs
- AmbiguousMatchException.cs
- StackSpiller.Generated.cs
- RouteParser.cs