Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ScheduleChanges.cs
- ImportContext.cs
- RandomNumberGenerator.cs
- InfoCardProofToken.cs
- PeerToPeerException.cs
- WebEventCodes.cs
- XPathSelfQuery.cs
- TemplateControlParser.cs
- XmlSchemaInfo.cs
- EventWaitHandleSecurity.cs
- Dictionary.cs
- MobileSysDescriptionAttribute.cs
- login.cs
- SpellerError.cs
- PathFigureCollection.cs
- FixedTextBuilder.cs
- WorkflowDispatchContext.cs
- AuthorizationBehavior.cs
- DataGridViewComboBoxCell.cs
- WbmpConverter.cs
- StrongNameMembershipCondition.cs
- XPathChildIterator.cs
- ConstantCheck.cs
- RetriableClipboard.cs
- Sentence.cs
- DbConnectionPoolGroup.cs
- WmlLinkAdapter.cs
- Menu.cs
- Ref.cs
- WorkflowOperationInvoker.cs
- RepeaterCommandEventArgs.cs
- RowToParametersTransformer.cs
- DataViewSettingCollection.cs
- PageWrapper.cs
- MimeReturn.cs
- JapaneseLunisolarCalendar.cs
- EntityContainer.cs
- QilReplaceVisitor.cs
- OledbConnectionStringbuilder.cs
- SingleAnimation.cs
- Image.cs
- SoapConverter.cs
- Overlapped.cs
- OperationResponse.cs
- HwndMouseInputProvider.cs
- AnimationStorage.cs
- RelationshipNavigation.cs
- NavigateUrlConverter.cs
- SizeFConverter.cs
- IdentitySection.cs
- CannotUnloadAppDomainException.cs
- XmlAttributeCache.cs
- VerificationException.cs
- FormatException.cs
- PropertyItem.cs
- ZoneButton.cs
- DataGridViewRowHeaderCell.cs
- KeySpline.cs
- ToolStripButton.cs
- FontResourceCache.cs
- WebZone.cs
- HttpListener.cs
- XmlSchemaParticle.cs
- CollectionBase.cs
- ColorContextHelper.cs
- WindowsEditBoxRange.cs
- DbProviderSpecificTypePropertyAttribute.cs
- WebBrowserSiteBase.cs
- RtfToken.cs
- NoResizeHandleGlyph.cs
- CellTreeSimplifier.cs
- Mouse.cs
- ArrayTypeMismatchException.cs
- BaseCollection.cs
- PreDigestedSignedInfo.cs
- InlineCollection.cs
- GeneralTransform3DCollection.cs
- MenuItemBinding.cs
- CellPartitioner.cs
- FileClassifier.cs
- ScriptReferenceBase.cs
- WebPartMinimizeVerb.cs
- VisualStyleInformation.cs
- CollectionConverter.cs
- PointLightBase.cs
- BitmapEffectInputData.cs
- ActivationServices.cs
- SingleAnimation.cs
- BuildProvider.cs
- RichTextBox.cs
- AvTraceDetails.cs
- ScrollViewer.cs
- XmlException.cs
- WindowsTokenRoleProvider.cs
- ViewBase.cs
- Transform3DGroup.cs
- SettingsPropertyValue.cs
- ContainerUtilities.cs
- DataServiceStreamProviderWrapper.cs
- MaskInputRejectedEventArgs.cs