Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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 } }/// Returns /// the substring that was matched. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleDbException.cs
- QueryCacheKey.cs
- xmlglyphRunInfo.cs
- FieldDescriptor.cs
- XmlDataProvider.cs
- DependencyPropertyDescriptor.cs
- ColumnMapCopier.cs
- TextEditorMouse.cs
- ConfigurationManagerInternalFactory.cs
- CounterSampleCalculator.cs
- Classification.cs
- SafeSerializationManager.cs
- BookmarkResumptionRecord.cs
- XmlSecureResolver.cs
- FacetEnabledSchemaElement.cs
- DbExpressionVisitor.cs
- LabelEditEvent.cs
- DataSourceComponent.cs
- UriScheme.cs
- WindowsSolidBrush.cs
- GifBitmapEncoder.cs
- PositiveTimeSpanValidator.cs
- EntityParameter.cs
- Win32SafeHandles.cs
- ByteFacetDescriptionElement.cs
- SubpageParaClient.cs
- FormClosedEvent.cs
- FixedDSBuilder.cs
- PrintEvent.cs
- CookieProtection.cs
- ServiceMetadataPublishingElement.cs
- PointF.cs
- ReliableSessionBindingElement.cs
- BCryptHashAlgorithm.cs
- BooleanConverter.cs
- StreamSecurityUpgradeAcceptorBase.cs
- ForeignConstraint.cs
- TransactionManager.cs
- ApplyTemplatesAction.cs
- WaveHeader.cs
- PageHandlerFactory.cs
- StretchValidation.cs
- ContextMenu.cs
- SqlCacheDependencyDatabase.cs
- DocumentEventArgs.cs
- TreeNodeCollection.cs
- NullExtension.cs
- GacUtil.cs
- CellRelation.cs
- ArraySubsetEnumerator.cs
- PropertyGeneratedEventArgs.cs
- SplitterPanelDesigner.cs
- XsdBuilder.cs
- HttpSocketManager.cs
- HttpCookie.cs
- XmlHierarchicalEnumerable.cs
- FileUtil.cs
- LinkClickEvent.cs
- CommunicationException.cs
- Int32Converter.cs
- ValueConversionAttribute.cs
- ImageBrush.cs
- SchemaCollectionPreprocessor.cs
- Matrix3DStack.cs
- PropertyItemInternal.cs
- TileModeValidation.cs
- CompModHelpers.cs
- CategoryGridEntry.cs
- TripleDESCryptoServiceProvider.cs
- MimeMapping.cs
- Listbox.cs
- ThrowOnMultipleAssignment.cs
- DoubleAnimationUsingKeyFrames.cs
- LostFocusEventManager.cs
- WeakHashtable.cs
- SortQuery.cs
- DrawingAttributeSerializer.cs
- FixedSOMLineCollection.cs
- KnownTypesHelper.cs
- SharedUtils.cs
- MimeFormReflector.cs
- SocketElement.cs
- JsonWriterDelegator.cs
- State.cs
- PeerEndPoint.cs
- WorkflowValidationFailedException.cs
- _NTAuthentication.cs
- Image.cs
- XmlSiteMapProvider.cs
- RemotingHelper.cs
- TransportDefaults.cs
- GeometryHitTestParameters.cs
- EventLogPermission.cs
- FormattedText.cs
- ToolBar.cs
- BitmapEffectInputConnector.cs
- ReferenceConverter.cs
- KeyEvent.cs
- Trace.cs
- ListDictionaryInternal.cs