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
- ComponentDispatcherThread.cs
- BasicDesignerLoader.cs
- FixedSOMPageElement.cs
- Win32.cs
- StructuralComparisons.cs
- TextSelectionHelper.cs
- ServiceModelSectionGroup.cs
- XmlSerializationGeneratedCode.cs
- TableLayoutPanelDesigner.cs
- BufferedGraphicsManager.cs
- _Win32.cs
- TextRange.cs
- LoginUtil.cs
- AgileSafeNativeMemoryHandle.cs
- DataGridViewControlCollection.cs
- SessionPageStatePersister.cs
- CompensationHandlingFilter.cs
- UriTemplatePathSegment.cs
- HebrewCalendar.cs
- XmlResolver.cs
- DataBinding.cs
- _Connection.cs
- Command.cs
- TextTreeExtractElementUndoUnit.cs
- RelatedPropertyManager.cs
- DataSourceCacheDurationConverter.cs
- MexServiceChannelBuilder.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- WindowsAuthenticationModule.cs
- WmlPhoneCallAdapter.cs
- ObjectHandle.cs
- SpecialTypeDataContract.cs
- EntityException.cs
- ExpressionLexer.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- DirectoryInfo.cs
- CommandDevice.cs
- SchemaCollectionPreprocessor.cs
- GridViewRow.cs
- WebPartAddingEventArgs.cs
- SecurityPolicySection.cs
- MissingManifestResourceException.cs
- HtmlSelect.cs
- TemplateInstanceAttribute.cs
- StorageRoot.cs
- CSharpCodeProvider.cs
- codemethodreferenceexpression.cs
- ProfileBuildProvider.cs
- DependencyObjectPropertyDescriptor.cs
- ControlPropertyNameConverter.cs
- SoapFault.cs
- DataSourceControlBuilder.cs
- StringUtil.cs
- FixedPosition.cs
- WebConvert.cs
- SequentialWorkflowHeaderFooter.cs
- HwndMouseInputProvider.cs
- ExpressionEvaluator.cs
- UpdatePanelTrigger.cs
- TimeSpanStorage.cs
- DispatcherFrame.cs
- HtmlInputSubmit.cs
- OutKeywords.cs
- XmlSchemaSequence.cs
- PerfCounterSection.cs
- LoginViewDesigner.cs
- IndentedTextWriter.cs
- InheritanceContextHelper.cs
- ConfigUtil.cs
- EntityDescriptor.cs
- ProcessModelInfo.cs
- ComponentChangingEvent.cs
- RouteItem.cs
- LineMetrics.cs
- AudioStateChangedEventArgs.cs
- ValueSerializer.cs
- BaseCollection.cs
- XmlSortKey.cs
- LayoutUtils.cs
- PersistenceTypeAttribute.cs
- WebPartCatalogAddVerb.cs
- SafeNativeMethods.cs
- PrintPreviewDialog.cs
- ExpressionParser.cs
- NamedPipeProcessProtocolHandler.cs
- MatrixStack.cs
- ClientOptions.cs
- GenericTextProperties.cs
- ModelItem.cs
- AssociationType.cs
- PersonalizableTypeEntry.cs
- NativeMethods.cs
- ValuePattern.cs
- CodeLabeledStatement.cs
- ViewPort3D.cs
- XmlResolver.cs
- RuntimeConfigurationRecord.cs
- Operand.cs
- HashCryptoHandle.cs
- SelectionList.cs