Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Regex / System / Text / RegularExpressions / RegexCapture.cs / 1305376 / 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 { ////// #if !SILVERLIGHT [ Serializable() ] #endif 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 } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007./// Returns /// the substring that was matched. /// ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetaType.cs
- TabItem.cs
- SqlBulkCopy.cs
- EventLogger.cs
- Win32Interop.cs
- UnitySerializationHolder.cs
- RealizationDrawingContextWalker.cs
- DataGridPagerStyle.cs
- DecoderFallbackWithFailureFlag.cs
- ConnectionPoint.cs
- ExeContext.cs
- SocketInformation.cs
- RequestTimeoutManager.cs
- DataGridViewCellStyle.cs
- KeySpline.cs
- XmlDataDocument.cs
- PropertyEntry.cs
- GridViewColumnHeaderAutomationPeer.cs
- ManipulationStartedEventArgs.cs
- TreeViewTemplateSelector.cs
- PenThreadWorker.cs
- ScanQueryOperator.cs
- __ComObject.cs
- XmlReader.cs
- XmlExceptionHelper.cs
- WebPartConnectionsDisconnectVerb.cs
- XmlMemberMapping.cs
- SpanIndex.cs
- Base64Stream.cs
- SHA256.cs
- _Connection.cs
- UIElementIsland.cs
- WriteTimeStream.cs
- ListenUriMode.cs
- BindingMAnagerBase.cs
- TreeNodeCollection.cs
- WorkflowRuntimeService.cs
- CompilationUtil.cs
- OdbcCommandBuilder.cs
- ColumnResult.cs
- TextRangeAdaptor.cs
- WindowsRichEdit.cs
- TextElement.cs
- SafeRightsManagementHandle.cs
- DocumentReference.cs
- DebugView.cs
- ItemList.cs
- PropertyMappingExceptionEventArgs.cs
- AsymmetricSecurityProtocolFactory.cs
- CodeTypeParameter.cs
- RegexInterpreter.cs
- SystemIPv4InterfaceProperties.cs
- ObjectDataSourceStatusEventArgs.cs
- CustomAssemblyResolver.cs
- CheckedListBox.cs
- StructuredProperty.cs
- ObjectStateManager.cs
- ViewLoader.cs
- TemplatePropertyEntry.cs
- HashHelper.cs
- Random.cs
- COAUTHIDENTITY.cs
- RulePatternOps.cs
- Events.cs
- PathGradientBrush.cs
- HttpRequestCacheValidator.cs
- ListChunk.cs
- ComNativeDescriptor.cs
- TextRangeSerialization.cs
- KerberosRequestorSecurityToken.cs
- HandleValueEditor.cs
- EmptyEnumerable.cs
- CodeTryCatchFinallyStatement.cs
- SrgsNameValueTag.cs
- MachinePropertyVariants.cs
- DataGridViewToolTip.cs
- ClockController.cs
- EntitySqlQueryState.cs
- dsa.cs
- EdmScalarPropertyAttribute.cs
- OperandQuery.cs
- Model3DGroup.cs
- CodeObject.cs
- XmlSchemaDocumentation.cs
- CodeSnippetTypeMember.cs
- BaseDataBoundControl.cs
- SplineKeyFrames.cs
- Utils.cs
- RegexMatch.cs
- DbUpdateCommandTree.cs
- HScrollProperties.cs
- DataPointer.cs
- MemberPath.cs
- Registry.cs
- HtmlAnchor.cs
- WbmpConverter.cs
- EDesignUtil.cs
- XXXOnTypeBuilderInstantiation.cs
- ImageFormatConverter.cs
- SqlMethodAttribute.cs