Code:
/ DotNET / DotNET / 8.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
- BinaryParser.cs
- PatternMatcher.cs
- CreateDataSourceDialog.cs
- IisNotInstalledException.cs
- ScriptReference.cs
- CodeAssignStatement.cs
- FileVersion.cs
- NullableDoubleMinMaxAggregationOperator.cs
- SqlProviderManifest.cs
- DeferredBinaryDeserializerExtension.cs
- ExpressionEvaluator.cs
- XmlBufferedByteStreamReader.cs
- ScrollChrome.cs
- NestedContainer.cs
- VerticalConnector.xaml.cs
- TaskDesigner.cs
- Int32EqualityComparer.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DataMemberListEditor.cs
- HtmlTitle.cs
- CallbackWrapper.cs
- PlatformNotSupportedException.cs
- ResourceAssociationType.cs
- HwndProxyElementProvider.cs
- TypeElement.cs
- WorkItem.cs
- DataGridViewLayoutData.cs
- BindUriHelper.cs
- WebPartConnectionsCancelEventArgs.cs
- SystemTcpStatistics.cs
- BuildProvider.cs
- ImportOptions.cs
- RadioButtonPopupAdapter.cs
- AutomationPatternInfo.cs
- InvokeProviderWrapper.cs
- XmlComplianceUtil.cs
- DateBoldEvent.cs
- DataServiceProcessingPipeline.cs
- FormViewCommandEventArgs.cs
- DataGridViewSortCompareEventArgs.cs
- XmlSchemaSimpleTypeRestriction.cs
- ResourceSetExpression.cs
- SoapFault.cs
- HierarchicalDataTemplate.cs
- ErrorLog.cs
- StringToken.cs
- BezierSegment.cs
- PolyQuadraticBezierSegment.cs
- WebControl.cs
- SafeEventLogReadHandle.cs
- DelegatingTypeDescriptionProvider.cs
- ColumnMap.cs
- Adorner.cs
- ResolvedKeyFrameEntry.cs
- HyperLink.cs
- RsaSecurityToken.cs
- ListViewItem.cs
- DataObjectMethodAttribute.cs
- XmlAttributes.cs
- UpdatePanelControlTrigger.cs
- DataGridRow.cs
- TextRunCacheImp.cs
- SHA256Cng.cs
- RadioButton.cs
- BitConverter.cs
- SubMenuStyle.cs
- HtmlLink.cs
- AudioDeviceOut.cs
- Clipboard.cs
- KeyedCollection.cs
- ErrorInfoXmlDocument.cs
- AccessDataSource.cs
- Mappings.cs
- XhtmlConformanceSection.cs
- AspNetCompatibilityRequirementsAttribute.cs
- Encoder.cs
- ISFClipboardData.cs
- SettingsSection.cs
- TreeNodeStyleCollection.cs
- HiddenFieldPageStatePersister.cs
- ListViewTableRow.cs
- ToolStripGrip.cs
- UserMapPath.cs
- MdiWindowListStrip.cs
- OdbcEnvironment.cs
- InteropAutomationProvider.cs
- TraceHwndHost.cs
- ObfuscateAssemblyAttribute.cs
- Identity.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- HyperLinkStyle.cs
- URLIdentityPermission.cs
- FamilyMap.cs
- ReaderContextStackData.cs
- CategoriesDocumentFormatter.cs
- BaseInfoTable.cs
- Reference.cs
- NamedServiceModelExtensionCollectionElement.cs
- ArrayTypeMismatchException.cs
- _NtlmClient.cs