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
- SingleConverter.cs
- LinqDataSource.cs
- ViewRendering.cs
- NameValuePermission.cs
- WebPartManager.cs
- RequestTimeoutManager.cs
- WebBrowserPermission.cs
- DataGrid.cs
- SamlSubject.cs
- SortFieldComparer.cs
- InputLangChangeRequestEvent.cs
- QueryReaderSettings.cs
- EventNotify.cs
- WindowPatternIdentifiers.cs
- Recipient.cs
- XPathAncestorQuery.cs
- CommandBinding.cs
- TableStyle.cs
- KeyGestureValueSerializer.cs
- EnumerableRowCollectionExtensions.cs
- SqlParameterCollection.cs
- TriggerAction.cs
- Shape.cs
- TreeNodeBindingDepthConverter.cs
- HyperLinkColumn.cs
- SQLInt32Storage.cs
- Properties.cs
- Inflater.cs
- FileNotFoundException.cs
- OdbcException.cs
- OleDbConnection.cs
- SHA1Managed.cs
- ZoneLinkButton.cs
- Variable.cs
- UIntPtr.cs
- MemberJoinTreeNode.cs
- RuleAttributes.cs
- AppLevelCompilationSectionCache.cs
- PropertyEmitterBase.cs
- DependencyPropertyHelper.cs
- ValidationError.cs
- WindowsFormsLinkLabel.cs
- PackUriHelper.cs
- GcSettings.cs
- SortFieldComparer.cs
- CorrelationRequestContext.cs
- FontStyleConverter.cs
- PageBuildProvider.cs
- XmlSchemaResource.cs
- BitmapEffectInput.cs
- StandardOleMarshalObject.cs
- TogglePattern.cs
- XMLSchema.cs
- ServiceHost.cs
- ProfileProvider.cs
- BitmapVisualManager.cs
- AsyncPostBackErrorEventArgs.cs
- QueryCacheManager.cs
- XmlChildEnumerator.cs
- SourceElementsCollection.cs
- EntityDataSourceWrapperCollection.cs
- InstanceKeyCollisionException.cs
- SchemaNames.cs
- UDPClient.cs
- SectionInput.cs
- SingleObjectCollection.cs
- Codec.cs
- ImageFormatConverter.cs
- PropertyConverter.cs
- Section.cs
- Win32Native.cs
- BatchStream.cs
- ToolStripDropDownMenu.cs
- DataGrid.cs
- ScriptingProfileServiceSection.cs
- DecimalConverter.cs
- ProxyAttribute.cs
- TextPattern.cs
- CheckBoxPopupAdapter.cs
- DockAndAnchorLayout.cs
- DataGridViewRowCancelEventArgs.cs
- DataSourceXmlAttributeAttribute.cs
- FormViewDeletedEventArgs.cs
- LambdaReference.cs
- UnmanagedMemoryStreamWrapper.cs
- QilInvokeEarlyBound.cs
- SectionInformation.cs
- Process.cs
- DocumentViewerBaseAutomationPeer.cs
- WizardStepBase.cs
- ProfileEventArgs.cs
- BehaviorDragDropEventArgs.cs
- DelegateInArgument.cs
- ConfigXmlElement.cs
- PropVariant.cs
- WindowsAuthenticationEventArgs.cs
- DataObjectAttribute.cs
- PointAnimationUsingKeyFrames.cs
- SequentialWorkflowRootDesigner.cs
- XmlIterators.cs