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
- CodeExpressionStatement.cs
- PointHitTestParameters.cs
- DbConnectionPoolIdentity.cs
- TextPenaltyModule.cs
- TextLineBreak.cs
- ControlIdConverter.cs
- TypeHelpers.cs
- FrameworkElement.cs
- PointF.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- SqlTriggerContext.cs
- MatrixTransform.cs
- NativeRecognizer.cs
- NewExpression.cs
- CodeDOMProvider.cs
- ParameterToken.cs
- Utils.cs
- ConfigurationHandlersInstallComponent.cs
- EntityDataSourceContextCreatedEventArgs.cs
- SlotInfo.cs
- ContextTokenTypeConverter.cs
- BinaryObjectWriter.cs
- TreeNodeBinding.cs
- SamlDelegatingWriter.cs
- AttachedAnnotationChangedEventArgs.cs
- Translator.cs
- ImageMetadata.cs
- EnterpriseServicesHelper.cs
- SingleAnimationBase.cs
- TypeLoadException.cs
- OleDbConnectionFactory.cs
- CryptoKeySecurity.cs
- unsafenativemethodsother.cs
- FileSystemInfo.cs
- DomainLiteralReader.cs
- HeaderedContentControl.cs
- ColorPalette.cs
- DataSourceNameHandler.cs
- SafeCoTaskMem.cs
- NonClientArea.cs
- _ShellExpression.cs
- CompiledQuery.cs
- DBDataPermissionAttribute.cs
- XmlBufferReader.cs
- RequestValidator.cs
- RotationValidation.cs
- TypeBrowser.xaml.cs
- RightsManagementInformation.cs
- ChildTable.cs
- BaseCollection.cs
- KeyTimeConverter.cs
- EncoderNLS.cs
- PerfCounterSection.cs
- Renderer.cs
- TextDecoration.cs
- Identity.cs
- ResXFileRef.cs
- MessageQueueKey.cs
- DbRetry.cs
- RegexCompilationInfo.cs
- ToolStripItem.cs
- ManualResetEvent.cs
- VisualStateManager.cs
- ValidatedControlConverter.cs
- HttpHandlersSection.cs
- HttpListenerRequestTraceRecord.cs
- Overlapped.cs
- NetworkInformationException.cs
- SettingsPropertyValue.cs
- StringValidator.cs
- SpotLight.cs
- XmlComplianceUtil.cs
- FileClassifier.cs
- AutoCompleteStringCollection.cs
- DelegateInArgument.cs
- SymbolType.cs
- StdValidatorsAndConverters.cs
- OutputCacheSection.cs
- BufferedGraphicsContext.cs
- LineServicesCallbacks.cs
- Mappings.cs
- DependentList.cs
- NativeCppClassAttribute.cs
- Image.cs
- ClaimSet.cs
- WeakReferenceKey.cs
- Constants.cs
- NameValuePermission.cs
- RecognitionEventArgs.cs
- TimelineGroup.cs
- keycontainerpermission.cs
- MouseButtonEventArgs.cs
- TextAdaptor.cs
- Vector3DCollection.cs
- OdbcTransaction.cs
- ViewManager.cs
- EventSchemaTraceListener.cs
- TimeSpanConverter.cs
- OperationInvokerBehavior.cs
- CopyAction.cs