Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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 } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ ///// Returns /// the substring that was matched. /// ///// 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 } } // 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
- TypedTableBase.cs
- DataSvcMapFileSerializer.cs
- CultureSpecificCharacterBufferRange.cs
- Thickness.cs
- Nullable.cs
- DataSourceSelectArguments.cs
- BulletChrome.cs
- WebEncodingValidator.cs
- NavigationCommands.cs
- PerformanceCounterPermissionEntryCollection.cs
- OleDbSchemaGuid.cs
- LoginName.cs
- SchemaConstraints.cs
- XLinq.cs
- CompleteWizardStep.cs
- EntityTransaction.cs
- CodeExpressionRuleDeclaration.cs
- NetDataContractSerializer.cs
- RuntimeHelpers.cs
- DbDataSourceEnumerator.cs
- Utils.cs
- PaperSize.cs
- Point.cs
- Pointer.cs
- DependencyPropertyAttribute.cs
- SqlConnection.cs
- SettingsContext.cs
- ComMethodElement.cs
- PerformanceCounter.cs
- LexicalChunk.cs
- RawAppCommandInputReport.cs
- PresentationSource.cs
- Crc32.cs
- WebEvents.cs
- RuleSetDialog.Designer.cs
- AstNode.cs
- QilInvoke.cs
- SecurityCredentialsManager.cs
- ServiceParser.cs
- XmlSignatureManifest.cs
- ProfilePropertySettingsCollection.cs
- Reference.cs
- securitycriticaldata.cs
- Decimal.cs
- PingReply.cs
- ContextQuery.cs
- Context.cs
- String.cs
- VisualStateGroup.cs
- ExcCanonicalXml.cs
- PowerModeChangedEventArgs.cs
- ADMembershipProvider.cs
- AsyncOperationManager.cs
- WindowsHyperlink.cs
- GroupStyle.cs
- ISAPIWorkerRequest.cs
- ObjectDataSourceDisposingEventArgs.cs
- InstanceDataCollectionCollection.cs
- safemediahandle.cs
- TextReader.cs
- RouteValueDictionary.cs
- Matrix3D.cs
- InputScope.cs
- SinglePhaseEnlistment.cs
- ProxyGenerationError.cs
- XmlSerializerFactory.cs
- SmiMetaDataProperty.cs
- TemplatePagerField.cs
- StrongNameSignatureInformation.cs
- MimeParameter.cs
- HandlerBase.cs
- ScrollChrome.cs
- WebPartConnection.cs
- GlyphInfoList.cs
- CallSiteOps.cs
- XpsDigitalSignature.cs
- ExpandSegmentCollection.cs
- CasesDictionary.cs
- ExpressionPrinter.cs
- InvalidOperationException.cs
- httpstaticobjectscollection.cs
- LineServices.cs
- ButtonField.cs
- DependencyPropertyChangedEventArgs.cs
- UInt32Storage.cs
- RayMeshGeometry3DHitTestResult.cs
- CollectionEditor.cs
- VectorCollectionValueSerializer.cs
- securestring.cs
- ExpressionEditor.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- ZipPackagePart.cs
- LocalizableResourceBuilder.cs
- ContentElement.cs
- nulltextnavigator.cs
- BindingValueChangedEventArgs.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- TableLayoutColumnStyleCollection.cs
- XsdDataContractExporter.cs
- SortKey.cs