You've already forked linux-packaging-mono
Rewrite with hard-coded offsets into the PE file format to discern if a binary is PE32 or PE32+, and then to determine if it contains a "CLR Data Directory" entry that looks valid. Tested with PE32 and PE32+ compiled Mono binaries, PE32 and PE32+ native binaries, and a random assortment of garbage files. Former-commit-id: 9e7ac86ec84f653a2f79b87183efd5b0ebda001b
2817 lines
263 KiB
XML
2817 lines
263 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<Type Name="Regex" FullName="System.Text.RegularExpressions.Regex">
|
||
<TypeSignature Language="C#" Maintainer="auto" Value="public class Regex : System.Runtime.Serialization.ISerializable" />
|
||
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit Regex extends System.Object implements class System.Runtime.Serialization.ISerializable" />
|
||
<AssemblyInfo>
|
||
<AssemblyName>System</AssemblyName>
|
||
<AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
|
||
<AssemblyVersion>1.0.3300.0</AssemblyVersion>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
|
||
<Base>
|
||
<BaseTypeName>System.Object</BaseTypeName>
|
||
</Base>
|
||
<Interfaces>
|
||
<Interface>
|
||
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
|
||
</Interface>
|
||
</Interfaces>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="T:System.Text.RegularExpressions.Regex" /> class represents the .NET Framework's regular expression engine. It can be used to quickly parse large amounts of text to find specific character patterns; to extract, edit, replace, or delete text substrings; and to add the extracted strings to a collection to generate a report.</para>
|
||
<block subset="none" type="note">
|
||
<para>If your primary interest is to validate a string by determining whether it conforms to a particular pattern, you can use the <see cref="T:System.Configuration.RegexStringValidator" /> class.</para>
|
||
</block>
|
||
<para>To use regular expressions, you define the pattern that you want to identify in a text stream by using the syntax documented in <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>. Next, you can optionally instantiate a <see cref="T:System.Text.RegularExpressions.Regex" /> object. Finally, you call a method that performs some operation, such as replacing text that matches the regular expression pattern, or identifying a pattern match.</para>
|
||
<format type="text/html">
|
||
<a href="#remarks" />
|
||
</format>
|
||
<format type="text/html">
|
||
<h2></h2>
|
||
</format>
|
||
<para>For more information about using the <see cref="T:System.Text.RegularExpressions.Regex" /> class, see the following sections:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#regex_vs_string">Regex vs. String Methods</a>
|
||
</format>
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#static_vs_instance">Static vs. Instance Methods</a>
|
||
</format>
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#regex_ops">Performing Regular Expression Operations</a>
|
||
</format>
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#define_timeout">Defining a Time-Out Value</a>
|
||
</format>
|
||
</para>
|
||
</item>
|
||
</list>
|
||
<format type="text/html">
|
||
<a href="#regex_vs_string" />
|
||
</format>
|
||
<format type="text/html">
|
||
<h2>Regex vs. String Methods</h2>
|
||
</format>
|
||
<para>The <see cref="T:System.String" /> class includes several search and comparison methods that you can use to perform pattern matching with text. For example, the <see cref="M:System.String.Contains(System.String)" />, <see cref="M:System.String.EndsWith(System.String)" />, and <see cref="M:System.String.StartsWith(System.String)" /> methods determine whether a string instance contains a specified substring; and the <see cref="M:System.String.IndexOf(System.String)" />, <see cref="M:System.String.IndexOfAny(System.Char[])" />, <see cref="M:System.String.LastIndexOf(System.String)" />, and <see cref="M:System.String.LastIndexOfAny(System.Char[],System.Int32,System.Int32)" /> methods return the starting position of a specified substring in a string. Use the methods of the <see cref="T:System.String" /> class when you are searching for a specific string. Use the <see cref="T:System.Text.RegularExpressions.Regex" /> class when you are searching for a specific pattern in a string. For more information and examples, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format>.</para>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#remarks">Back to Remarks</a>
|
||
</format>
|
||
</para>
|
||
<format type="text/html">
|
||
<a href="#static_vs_instance" />
|
||
</format>
|
||
<format type="text/html">
|
||
<h2>Static vs. Instance Methods</h2>
|
||
</format>
|
||
<para>After you define a regular expression pattern, you can provide it to the regular expression engine in either of two ways:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>By instantiating a <see cref="T:System.Text.RegularExpressions.Regex" /> object that represents the regular expression. To do this, you pass the regular expression pattern to a <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String)" /> constructor. A <see cref="T:System.Text.RegularExpressions.Regex" /> object is immutable; when you instantiate a <see cref="T:System.Text.RegularExpressions.Regex" /> object with a regular expression, that object's regular expression cannot be changed.</para>
|
||
</item>
|
||
<item>
|
||
<para>By supplying both the regular expression and the text to search to a static (Shared in Visual Basic) <see cref="T:System.Text.RegularExpressions.Regex" /> method. This enables you to use a regular expression without explicitly creating a <see cref="T:System.Text.RegularExpressions.Regex" /> object.</para>
|
||
</item>
|
||
</list>
|
||
<para>All <see cref="T:System.Text.RegularExpressions.Regex" /> pattern identification methods include both static and instance overloads. </para>
|
||
<para>The regular expression engine must compile a particular pattern before the pattern can be used. Because <see cref="T:System.Text.RegularExpressions.Regex" /> objects are immutable, this is a one-time procedure that occurs when a <see cref="T:System.Text.RegularExpressions.Regex" /> class constructor or a static method is called. To eliminate the need to repeatedly compile a single regular expression, the regular expression engine caches the compiled regular expressions used in static method calls. As a result, regular expression pattern-matching methods offer comparable performance for static and instance methods.</para>
|
||
<block subset="none" type="note">
|
||
<para>In the .NET Framework versions 1.0 and 1.1, all compiled regular expressions, whether they were used in instance or static method calls, were cached. Starting with the .NET Framework 2.0, only regular expressions used in static method calls are cached. </para>
|
||
</block>
|
||
<para>However, caching can adversely affect performance in the following two cases:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>When you use static method calls with a large number of regular expressions. By default, the regular expression engine caches the 15 most recently used static regular expressions. If your application uses more than 15 static regular expressions, some regular expressions must be recompiled. To prevent this recompilation, you can increase the <see cref="P:System.Text.RegularExpressions.Regex.CacheSize" /> property.</para>
|
||
</item>
|
||
<item>
|
||
<para>When you instantiate new <see cref="T:System.Text.RegularExpressions.Regex" /> objects with regular expressions that have previously been compiled. For example, the following code defines a regular expression to locate duplicated words in a text stream. Although the example uses a single regular expression, it instantiates a new <see cref="T:System.Text.RegularExpressions.Regex" /> object to process each line of text. This results in the recompilation of the regular expression with each iteration of the loop.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Class.Caching#1</para>
|
||
<para>To prevent recompilation, you should instantiate a single <see cref="T:System.Text.RegularExpressions.Regex" /> object that is accessible to all code that requires it, as shown in the following rewritten example.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Class.Caching#2</para>
|
||
</item>
|
||
</list>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#remarks">Back to Remarks</a>
|
||
</format>
|
||
</para>
|
||
<format type="text/html">
|
||
<a href="#regex_ops" />
|
||
</format>
|
||
<format type="text/html">
|
||
<h2>Performing Regular Expression Operations</h2>
|
||
</format>
|
||
<para>Whether you decide to instantiate a <see cref="T:System.Text.RegularExpressions.Regex" /> object and call its methods or call static methods, the <see cref="T:System.Text.RegularExpressions.Regex" /> class offers the following pattern-matching functionality:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>Validation of a match. You call the <see cref="Overload:System.Text.RegularExpressions.Regex.IsMatch" /> method to determine whether a match is present.</para>
|
||
</item>
|
||
<item>
|
||
<para>Retrieval of a single match. You call the <see cref="Overload:System.Text.RegularExpressions.Regex.Match" /> method to retrieve a <see cref="T:System.Text.RegularExpressions.Match" /> object that represents the first match in a string or in part of a string. Subsequent matches can be retrieved by calling the <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method.</para>
|
||
</item>
|
||
<item>
|
||
<para>Retrieval of all matches. You call the <see cref="Overload:System.Text.RegularExpressions.Regex.Matches" /> method to retrieve a <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object that represents all the matches found in a string or in part of a string.</para>
|
||
</item>
|
||
<item>
|
||
<para>Replacement of matched text. You call the <see cref="Overload:System.Text.RegularExpressions.Regex.Replace" /> method to replace matched text. The replacement text can also be defined by a regular expression. In addition, some of the <see cref="Overload:System.Text.RegularExpressions.Regex.Replace" /> methods include a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> parameter that enables you to programmatically define the replacement text.</para>
|
||
</item>
|
||
<item>
|
||
<para>Creation of a string array that is formed from parts of an input string. You call the <see cref="Overload:System.Text.RegularExpressions.Regex.Split" /> method to split an input string at positions that are defined by the regular expression.</para>
|
||
</item>
|
||
</list>
|
||
<para>In addition to its pattern-matching methods, the <see cref="T:System.Text.RegularExpressions.Regex" /> class includes several special-purpose methods:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> method escapes any characters that may be interpreted as regular expression operators in a regular expression or input string. </para>
|
||
</item>
|
||
<item>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Unescape(System.String)" /> method removes these escape characters. </para>
|
||
</item>
|
||
<item>
|
||
<para>The <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method creates an assembly that contains predefined regular expressions. The .NET Framework contains examples of these special-purpose assemblies in the <see cref="N:System.Web.RegularExpressions" /> namespace.</para>
|
||
</item>
|
||
</list>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#remarks">Back to Remarks</a>
|
||
</format>
|
||
</para>
|
||
<format type="text/html">
|
||
<a href="#define_timeout" />
|
||
</format>
|
||
<format type="text/html">
|
||
<h2>Defining a Time-Out Value</h2>
|
||
</format>
|
||
<para>The .NET Framework supports a full-featured regular expression language that provides substantial power and flexibility in pattern matching. However, the power and flexibility come at a cost: the risk of poor performance. Regular expressions that perform poorly are surprisingly easy to create. In some cases, regular expression operations that rely on excessive backtracking can appear to stop responding when they process text that nearly matches the regular expression pattern. For more information about the .NET Framework regular expression engine, see <format type="text/html"><a href="0ee1a6b8-caac-41d2-917f-d35570021b10">Details of Regular Expression Behavior</a></format>. For more information about excessive backtracking, see <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>.</para>
|
||
<para>Starting with the net_v45, you can define a time-out interval for regular expression matches. If the regular expression engine cannot identify a match within this time interval, the matching operation throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. In most cases, this prevents the regular expression engine from wasting processing power by trying to match text that nearly matches the regular expression pattern. It also could indicate, however, that the timeout interval has been set too low, or that the current machine load has caused an overall degradation in performance.</para>
|
||
<para>How you handle the exception depends on the cause of the exception. If the exception occurs because the time-out interval is set too low or because of excessive machine load, you can increase the time-out interval and retry the matching operation. If the exception occurs because the regular expression relies on excessive backtracking, you can assume that a match does not exist, and, optionally, you can log information that will help you modify the regular expression pattern.</para>
|
||
<para>You can set a time-out interval by calling the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor when you instantiate a regular expression object. For static methods, you can set a time-out interval by calling an overload of a matching method that has a <paramref name="matchTimeout" /> parameter. If you do not set a time-out value explicitly, the default time-out value is determined as follows:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>By using the application-wide time-out value, if one exists. This can be any time-out value that applies to the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is instantiated or the static method call is made. You can set the application-wide time-out value by calling the <see cref="M:System.AppDomain.SetData(System.String,System.Object)" /> method to assign the string representation of a <see cref="T:System.TimeSpan" /> value to the "REGEX_DEFAULT_MATCH_TIMEOUT" property.</para>
|
||
</item>
|
||
<item>
|
||
<para>By using the value <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, if no application-wide time-out value has been set.</para>
|
||
</item>
|
||
</list>
|
||
<block subset="none" type="note">
|
||
<para>We recommend that you set a time-out value in all regular expression pattern-matching operations. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format>.</para>
|
||
</block>
|
||
<para>
|
||
<format type="text/html">
|
||
<a href="#remarks">Back to Remarks</a>
|
||
</format>
|
||
</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Represents an immutable regular expression.</para>
|
||
</summary>
|
||
</Docs>
|
||
<Members>
|
||
<Member MemberName=".ctor">
|
||
<MemberSignature Language="C#" Value="protected Regex ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
|
||
<MemberType>Constructor</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue />
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>To be added</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName=".ctor">
|
||
<MemberSignature Language="C#" Value="public Regex (string pattern);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string pattern) cil managed" />
|
||
<MemberType>Constructor</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue />
|
||
<Parameters>
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see the <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format> topics.</para>
|
||
<para>Calling the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String)" /> constructor is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions)" /> constructor with a value of <see cref="F:System.Text.RegularExpressions.RegexOptions.None" /> for the <paramref name="options" /> argument.</para>
|
||
<para>A <see cref="T:System.Text.RegularExpressions.Regex" /> object is immutable, which means that it can be used only for the match pattern you define when you create it. However, it can be used any number of times without being recompiled.</para>
|
||
<para>This constructor instantiates a regular expression object that attempts a case-sensitive match of any alphabetical characters defined in <paramref name="pattern" />. For a case-insensitive match, use the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions)" /> constructor.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class for the specified regular expression.</para>
|
||
</summary>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName=".ctor">
|
||
<MemberSignature Language="C#" Value="protected Regex (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
|
||
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
|
||
<MemberType>Constructor</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Parameters>
|
||
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" />
|
||
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class by using serialized data.</para>
|
||
</summary>
|
||
<param name="info">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The object that contains a serialized pattern and <see cref="T:System.Text.RegularExpressions.RegexOptions" /> information.</param>
|
||
<param name="context">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The destination for this serialization. (This parameter is not used; specify null.)</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName=".ctor">
|
||
<MemberSignature Language="C#" Value="public Regex (string pattern, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string pattern, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Constructor</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue />
|
||
<Parameters>
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see the <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format> topics.</para>
|
||
<para>A <see cref="T:System.Text.RegularExpressions.Regex" /> object is immutable, which means that it can be used only for the match parameters you define when you create it. However, it can be used any number of times without being recompiled.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class for the specified regular expression, with options that modify the pattern.</para>
|
||
</summary>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that modify the regular expression. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName=".ctor">
|
||
<MemberSignature Language="C#" Value="public Regex (string pattern, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string pattern, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Constructor</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<Parameters>
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see the <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format> topics.</para>
|
||
<para>A <see cref="T:System.Text.RegularExpressions.Regex" /> object is immutable, which means that it can be used only for the match pattern that you define when you create it. However, it can be used any number of times without being recompiled.</para>
|
||
<para>The <paramref name="matchTimeout" /> parameter specifies how long a pattern-matching method should try to find a match before it times out. If no match is found in that time interval, the pattern-matching method throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. <paramref name="matchTimeout" /> overrides any default time-out value defined for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. The instance pattern-matching methods that observe the <paramref name="matchTimeout" /> time-out interval include the following:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Match(System.String)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.String)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Match.NextMatch" />
|
||
</para>
|
||
</item>
|
||
</list>
|
||
<para>Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to stop responding when they process input that contains near matches. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format> and <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>. To set a reasonable time-out interval, consider the following factors:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The length and complexity of the regular expression pattern. Longer and more complex regular expressions require more time than shorter and simpler ones.</para>
|
||
</item>
|
||
<item>
|
||
<para>The expected machine load. Processing takes more time on systems that have high CPU and memory utilization.</para>
|
||
</item>
|
||
</list>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Initializes a new instance of the <see cref="T:System.Text.RegularExpressions.Regex" /> class for the specified regular expression, with options that modify the pattern and a value that specifies how long a pattern matching method should attempt a match before it times out.</para>
|
||
</summary>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that modify the regular expression.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="CacheSize">
|
||
<MemberSignature Language="C#" Value="public static int CacheSize { get; set; }" />
|
||
<MemberSignature Language="ILAsm" Value=".property int32 CacheSize" />
|
||
<MemberType>Property</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Int32</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<value>To be added.</value>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="T:System.Text.RegularExpressions.Regex" /> class maintains an internal cache of compiled regular expressions used in static method calls. If the value specified in a set operation is less than the current cache size, cache entries are discarded until the cache size is equal to the specified value. </para>
|
||
<para>By default, the cache holds 15 compiled static regular expressions. Your application typically will not have to modify the size of the cache. Use the <see cref="P:System.Text.RegularExpressions.Regex.CacheSize" /> property only when you want to turn off caching or when you have an unusually large cache.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Gets or sets the maximum number of entries in the current static cache of compiled regular expressions.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="capnames">
|
||
<MemberSignature Language="C#" Value="protected System.Collections.Hashtable capnames;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly class System.Collections.Hashtable capnames" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Collections.Hashtable</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="caps">
|
||
<MemberSignature Language="C#" Value="protected System.Collections.Hashtable caps;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly class System.Collections.Hashtable caps" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Collections.Hashtable</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="capsize">
|
||
<MemberSignature Language="C#" Value="protected int capsize;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly int32 capsize" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Int32</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="capslist">
|
||
<MemberSignature Language="C#" Value="protected string[] capslist;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly string[] capslist" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="CompileToAssembly">
|
||
<MemberSignature Language="C#" Value="public static void CompileToAssembly (System.Text.RegularExpressions.RegexCompilationInfo[] regexes, System.Reflection.AssemblyName aname);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void CompileToAssembly(class System.Text.RegularExpressions.RegexCompilationInfo[] regexes, class System.Reflection.AssemblyName aname) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Void</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="regexes" Type="System.Text.RegularExpressions.RegexCompilationInfo[]" />
|
||
<Parameter Name="aname" Type="System.Reflection.AssemblyName" />
|
||
</Parameters>
|
||
<Docs>
|
||
<param name="regexes">To be added.</param>
|
||
<param name="aname">To be added.</param>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName)" /> method generates a .NET Framework assembly in which each regular expression defined in the <paramref name="regexinfos" /> array is represented by a class. Typically, the <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName)" /> method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>It is derived from the <see cref="T:System.Text.RegularExpressions.Regex" /> class.</para>
|
||
</item>
|
||
<item>
|
||
<para>It is assigned the fully qualified name that is defined by the <paramref name="fullnamespace" /> and <paramref name="name" /> parameters of its corresponding <see cref="T:System.Text.RegularExpressions.RegexCompilationInfo" /> object.</para>
|
||
</item>
|
||
<item>
|
||
<para>It has a default (or parameterless) constructor.</para>
|
||
</item>
|
||
</list>
|
||
<para>Ordinarily, the code that instantiates and uses the compiled regular expression is found in an assembly or application that is separate from the code that creates the assembly.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Compiles one or more specified <see cref="T:System.Text.RegularExpressions.Regex" /> objects to a named assembly.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="CompileToAssembly">
|
||
<MemberSignature Language="C#" Value="public static void CompileToAssembly (System.Text.RegularExpressions.RegexCompilationInfo[] regexes, System.Reflection.AssemblyName aname, System.Reflection.Emit.CustomAttributeBuilder[] attribs);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void CompileToAssembly(class System.Text.RegularExpressions.RegexCompilationInfo[] regexes, class System.Reflection.AssemblyName aname, class System.Reflection.Emit.CustomAttributeBuilder[] attribs) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Void</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="regexes" Type="System.Text.RegularExpressions.RegexCompilationInfo[]" />
|
||
<Parameter Name="aname" Type="System.Reflection.AssemblyName" />
|
||
<Parameter Name="attribs" Type="System.Reflection.Emit.CustomAttributeBuilder[]" />
|
||
</Parameters>
|
||
<Docs>
|
||
<param name="regexes">To be added.</param>
|
||
<param name="aname">To be added.</param>
|
||
<param name="attribs">To be added.</param>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName,System.Reflection.Emit.CustomAttributeBuilder[])" /> method generates a .NET Framework assembly in which each regular expression defined in the <paramref name="regexinfos" /> array is represented by a class. Typically, the <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName,System.Reflection.Emit.CustomAttributeBuilder[])" /> method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>It is derived from the <see cref="T:System.Text.RegularExpressions.Regex" /> class.</para>
|
||
</item>
|
||
<item>
|
||
<para>It is assigned the fully qualified name that is defined by the <paramref name="fullnamespace" /> and <paramref name="name" /> parameters of its corresponding <see cref="T:System.Text.RegularExpressions.RegexCompilationInfo" /> object.</para>
|
||
</item>
|
||
<item>
|
||
<para>It has a default (or parameterless) constructor.</para>
|
||
</item>
|
||
</list>
|
||
<para>Ordinarily, the code that instantiates and uses the compiled regular expression is found in an assembly or application that is separate from the code that creates the assembly.</para>
|
||
<para>Because the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method generates a .NET Framework assembly from a method call instead of using a particular language's class definition keyword (such as class in C# or Class…End Class in Visual Basic), it does not allow .NET Framework attributes to be assigned to the assembly by using the development language's standard attribute syntax. The <paramref name="attributes" /> parameter provides an alternative method for defining the attributes that apply to the assembly. For each attribute that you want to apply to the assembly, do the following:</para>
|
||
<list type="ordered">
|
||
<item>
|
||
<para>Create an array of <see cref="T:System.Type" /> objects representing the parameter types of the attribute constructor that you want to call. </para>
|
||
</item>
|
||
<item>
|
||
<para>Retrieve a <see cref="T:System.Type" /> object representing the attribute class that you want to apply to the new assembly.</para>
|
||
</item>
|
||
<item>
|
||
<para>Call the <see cref="M:System.Type.GetConstructor(System.Type[])" /> method of the attribute <see cref="T:System.Type" /> object to retrieve a <see cref="T:System.Reflection.ConstructorInfo" /> object representing the attribute constructor that you want to call. Pass the <see cref="M:System.Type.GetConstructor(System.Type[])" /> method the array of <see cref="T:System.Type" /> objects that represents the constructor's parameter types.</para>
|
||
</item>
|
||
<item>
|
||
<para>Create a <see cref="T:System.Object" /> array that defines the parameters to pass to the attribute's constructor.</para>
|
||
</item>
|
||
<item>
|
||
<para>Instantiate a <see cref="T:System.Reflection.Emit.CustomAttributeBuilder" /> object by passing its constructor the <see cref="T:System.Reflection.ConstructorInfo" /> object retrieved in step 3 and the <see cref="T:System.Object" /> array created in step 4.</para>
|
||
</item>
|
||
</list>
|
||
<para>You can then pass an array of these <see cref="T:System.Reflection.Emit.CustomAttributeBuilder" /> objects instead of the <paramref name="attributes" /> parameter to the <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName,System.Reflection.Emit.CustomAttributeBuilder[])" /> method.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Compiles one or more specified <see cref="T:System.Text.RegularExpressions.Regex" /> objects to a named assembly with the specified attributes.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="CompileToAssembly">
|
||
<MemberSignature Language="C#" Value="public static void CompileToAssembly (System.Text.RegularExpressions.RegexCompilationInfo[] regexes, System.Reflection.AssemblyName aname, System.Reflection.Emit.CustomAttributeBuilder[] attribs, string resourceFile);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void CompileToAssembly(class System.Text.RegularExpressions.RegexCompilationInfo[] regexes, class System.Reflection.AssemblyName aname, class System.Reflection.Emit.CustomAttributeBuilder[] attribs, string resourceFile) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Void</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="regexes" Type="System.Text.RegularExpressions.RegexCompilationInfo[]" />
|
||
<Parameter Name="aname" Type="System.Reflection.AssemblyName" />
|
||
<Parameter Name="attribs" Type="System.Reflection.Emit.CustomAttributeBuilder[]" />
|
||
<Parameter Name="resourceFile" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<param name="regexes">To be added.</param>
|
||
<param name="aname">To be added.</param>
|
||
<param name="attribs">To be added.</param>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName,System.Reflection.Emit.CustomAttributeBuilder[],System.String)" /> method generates a .NET Framework assembly in which each regular expression defined in the <paramref name="regexinfos" /> array is represented by a class. Typically, the <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName,System.Reflection.Emit.CustomAttributeBuilder[],System.String)" /> method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>It is derived from the <see cref="T:System.Text.RegularExpressions.Regex" /> class.</para>
|
||
</item>
|
||
<item>
|
||
<para>It is assigned the fully qualified name that is defined by the <paramref name="fullnamespace" /> and <paramref name="name" /> parameters of its corresponding <see cref="T:System.Text.RegularExpressions.RegexCompilationInfo" /> object.</para>
|
||
</item>
|
||
<item>
|
||
<para>It has a default (or parameterless) constructor.</para>
|
||
</item>
|
||
</list>
|
||
<para>Ordinarily, the code that instantiates and uses the compiled regular expression is found in an assembly or application that is separate from the code that creates the assembly.</para>
|
||
<para>Because the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method generates a .NET Framework assembly from a method call instead of using a particular language's class definition keyword (such as class in C# or Class…End Class in Visual Basic), it does not allow .NET Framework attributes to be assigned to the assembly by using the development language's standard attribute syntax. The <paramref name="attributes" /> parameter provides an alternative method for defining the attributes that apply to the assembly. For each attribute that you want to apply to the assembly, do the following:</para>
|
||
<list type="ordered">
|
||
<item>
|
||
<para>Create an array of <see cref="T:System.Type" /> objects representing the parameter types of the attribute constructor that you want to call. </para>
|
||
</item>
|
||
<item>
|
||
<para>Retrieve a <see cref="T:System.Type" /> object representing the attribute class that you want to apply to the new assembly.</para>
|
||
</item>
|
||
<item>
|
||
<para>Call the <see cref="M:System.Type.GetConstructor(System.Type[])" /> method of the attribute <see cref="T:System.Type" /> object to retrieve a <see cref="T:System.Reflection.ConstructorInfo" /> object representing the attribute constructor that you want to call. Pass the <see cref="M:System.Type.GetConstructor(System.Type[])" /> method the array of <see cref="T:System.Type" /> objects that represents the constructor's parameter types</para>
|
||
</item>
|
||
<item>
|
||
<para>Create a <see cref="T:System.Object" /> array that defines the parameters to pass to the attribute's constructor.</para>
|
||
</item>
|
||
<item>
|
||
<para>Instantiate a <see cref="T:System.Reflection.Emit.CustomAttributeBuilder" /> object by passing its constructor the <see cref="T:System.Reflection.ConstructorInfo" /> object retrieved in step 3 and the <see cref="T:System.Object" /> array created in step 4.</para>
|
||
</item>
|
||
</list>
|
||
<para>You can then pass an array of these <see cref="T:System.Reflection.Emit.CustomAttributeBuilder" /> objects instead of the <paramref name="attributes" /> parameter to the <see cref="M:System.Text.RegularExpressions.Regex.CompileToAssembly(System.Text.RegularExpressions.RegexCompilationInfo[],System.Reflection.AssemblyName,System.Reflection.Emit.CustomAttributeBuilder[],System.String)" /> method.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Compiles one or more specified <see cref="T:System.Text.RegularExpressions.Regex" /> objects and a specified resource file to a named assembly with the specified attributes.</para>
|
||
</summary>
|
||
<param name="resourceFile">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The name of the Win32 resource file to include in the assembly. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Escape">
|
||
<MemberSignature Language="C#" Value="public static string Escape (string str);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Escape(string str) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="str" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> converts a string so that the regular expression engine will interpret any metacharacters that it may contain as character literals. For example, consider a regular expression that is designed to extract comments that are delimited by straight opening and closing brackets ([ and ]) from text. In the following example, the regular expression "[(.*?)]" is interpreted as a character class. Rather than matching comments embedded in the input text, the regular expression matches each opening or closing parenthesis, period, asterisk, or question mark.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Escape#1</para>
|
||
<para>However, if the opening bracket is escaped by passing it to the <see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> method, the regular expression succeeds in matching comments that are embedded in the input string. The following example illustrates this.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Escape#2</para>
|
||
<para>In a regular expression that is defined by using static text, characters that are to be interpreted literally rather than as metacharacters can be escaped by preceding them with a backslash symbol (\) as well as by calling the <see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> method. In a regular expression that is defined dynamically using characters that are not known at design time, calling the <see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> method is particularly important to ensure that the regular expression engine interprets individual characters as literals rather than as metacharacters. </para>
|
||
<block subset="none" type="note">
|
||
<para>If a regular expression pattern includes either the number sign (#) or literal white-space characters, they must be escaped if input text is parsed with the <see cref="F:System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace" /> option enabled.</para>
|
||
</block>
|
||
<para>While the <see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> method escapes the straight opening bracket ([) and opening brace ({) characters, it does not escape their corresponding closing characters (] and }). In most cases, escaping these is not necessary. If a closing bracket or brace is not preceded by its corresponding opening character, the regular expression engine interprets it literally. If an opening braket or brace is interpreted as a metacharacter, the regular expression engine interprets the first corresponding closing character as a metacharacter. If this is not the desired behavior, the closing bracket or brace should be escaped by explicitly prepending the backslash (\) character. For an illustration, see the Example section.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Escapes a minimal set of characters (\, *, +, ?, |, {, [, (,), ^, $,., #, and white space) by replacing them with their escape codes. This instructs the regular expression engine to interpret these characters literally rather than as metacharacters.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A string of characters with metacharacters converted to their escaped form.</para>
|
||
</returns>
|
||
<param name="str">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The input string that contains the text to convert. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="factory">
|
||
<MemberSignature Language="C#" Value="protected System.Text.RegularExpressions.RegexRunnerFactory factory;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly class System.Text.RegularExpressions.RegexRunnerFactory factory" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.RegexRunnerFactory</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Finalize">
|
||
<MemberSignature Language="C#" Value="~Regex ();" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Void</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<summary>To be added.</summary>
|
||
<remarks>To be added.</remarks>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="GetGroupNames">
|
||
<MemberSignature Language="C#" Value="public string[] GetGroupNames ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] GetGroupNames() cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The collection of group names contains the set of strings used to name capturing groups in the expression. Even if capturing groups are not explicitly named, they are automatically assigned numerical names (1, 2, 3, and so on). Therefore, this collection can be used to determine the number of groups.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Returns an array of capturing group names for the regular expression.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A string array of group names.</para>
|
||
</returns>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="GetGroupNumbers">
|
||
<MemberSignature Language="C#" Value="public int[] GetGroupNumbers ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance int32[] GetGroupNumbers() cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Int32[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Both unnamed and named capturing groups can be accessed by number. Unnamed groups are numbered from left to right starting with 1. (The capturing group in index 0 (zero) represents the match as a whole.) Named groups are then numbered from left to right starting with a number that is one greater than the number of unnamed capturing groups.</para>
|
||
<para>Referencing a group by its number instead of by string name can provide faster access.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Returns an array of capturing group numbers that correspond to group names in an array.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An integer array of group numbers.</para>
|
||
</returns>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="GroupNameFromNumber">
|
||
<MemberSignature Language="C#" Value="public string GroupNameFromNumber (int i);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string GroupNameFromNumber(int32 i) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="i" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A regular expression pattern may contain either named or numbered capturing groups, which delineate subexpressions within a pattern match. Numbered groups are delimited by the syntax (subexpression) and are assigned numbers based on their order in the regular expression. Named groups are delimited by the syntax (?<name>subexpression) or (?'name'subexpression), where name is the name by which the subexpression will be identified. (For more information, see <format type="text/html"><a href="0fc18634-f590-4062-8d5c-f0b71abe405b">Grouping Constructs</a></format>.) The <see cref="M:System.Text.RegularExpressions.Regex.GroupNameFromNumber(System.Int32)" /> method identifies both named groups and numbered groups by their ordinal positions in the regular expression. Ordinal position zero always represents the entire regular expression. All numbered groups are then counted before named groups, regardless of their actual position in the regular expression pattern. </para>
|
||
<para>If <paramref name="i" /> is the number of a named group, the method returns the name of the group. If <paramref name="i" /> is the number of an unnamed group, the method returns the string representation of the number. For example, if <paramref name="i" /> is 1, the method returns "1". If <paramref name="i" /> is not the number of a capturing group, the method returns <see cref="F:System.String.Empty" />.</para>
|
||
<para>If a pattern match is found, the value returned by this method can then be used to retrieve the <see cref="T:System.Text.RegularExpressions.Group" /> object that represents the captured group from the <see cref="P:System.Text.RegularExpressions.GroupCollection.Item(System.Int32)" /> property. The <see cref="T:System.Text.RegularExpressions.GroupCollection" /> object is returned by the <see cref="P:System.Text.RegularExpressions.Match.Groups" /> property.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Gets the group name that corresponds to the specified group number.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A string that contains the group name associated with the specified group number. If there is no group name that corresponds to <paramref name="i" />, the method returns <see cref="F:System.String.Empty" />.</para>
|
||
</returns>
|
||
<param name="i">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The group number to convert to the corresponding group name. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="GroupNumberFromName">
|
||
<MemberSignature Language="C#" Value="public int GroupNumberFromName (string name);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance int32 GroupNumberFromName(string name) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Int32</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="name" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A regular expression pattern may contain either named or numbered capturing groups, which delineate subexpressions within a pattern match. Numbered groups are delimited by the syntax (subexpression) and are assigned numbers based on their order in the regular expression. Named groups are delimited by the syntax (?<name>subexpression) or (?'name'subexpression), where name is the name by which the subexpression will be identified. (For more information, see <format type="text/html"><a href="0fc18634-f590-4062-8d5c-f0b71abe405b">Grouping Constructs</a></format>.) The <see cref="M:System.Text.RegularExpressions.Regex.GroupNumberFromName(System.String)" /> method identifies both named groups and numbered groups by their ordinal positions in the regular expression. Ordinal position zero always represents the entire regular expression. All numbered groups are then counted before named groups, regardless of their actual position in the regular expression pattern. </para>
|
||
<para>If <paramref name="name" /> is the string representation of a group number that is present in the regular expression pattern, the method returns that number. If <paramref name="name" /> corresponds to a named capturing group that is present in the regular expression pattern, the method returns its corresponding number. The comparison of <paramref name="name" /> with the group name is case-sensitive. If <paramref name="name" /> does not correspond to the name of a capturing group or to the string representation of the number of a capturing group, the method returns -1.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Returns the group number that corresponds to the specified group name.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The group number that corresponds to the specified group name, or -1 if <paramref name="name" /> is not a valid group name.</para>
|
||
</returns>
|
||
<param name="name">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The group name to convert to the corresponding group number. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="InfiniteMatchTimeout">
|
||
<MemberSignature Language="C#" Value="public static readonly TimeSpan InfiniteMatchTimeout;" />
|
||
<MemberSignature Language="ILAsm" Value=".field public static initonly valuetype System.TimeSpan InfiniteMatchTimeout" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.TimeSpan</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> class constructor and a number of static matching methods use the <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> constant to indicate that the attempt to find a pattern match should not time out.</para>
|
||
<block subset="none" type="note">
|
||
<para>Setting the regular expression engine's time-out value to <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> can cause regular expressions that rely on excessive backtracking to appear to stop responding when processing text that nearly matches the regular expression pattern. If you disable time-outs, you should ensure that your regular expression does not rely on excessive backtracking and that it handles text that nearly matches the regular expression pattern.</para>
|
||
<para>For more information about handling backtracking, see <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>.</para>
|
||
</block>
|
||
<para>The <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> constant can be supplied as the value of the <paramref name="matchTimeout" /> argument of the following members:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.RegexCompilationInfo.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.String,System.String,System.Boolean,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.String,System.Text.RegularExpressions.MatchEvaluator,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
<item>
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Split(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" />
|
||
</para>
|
||
</item>
|
||
</list>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Specifies that a pattern-matching operation should not time out.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="InitializeReferences">
|
||
<MemberSignature Language="C#" Value="protected void InitializeReferences ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance void InitializeReferences() cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Void</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>To be added</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="IsMatch">
|
||
<MemberSignature Language="C#" Value="public bool IsMatch (string input);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsMatch(string input) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="Overload:System.Text.RegularExpressions.Regex.IsMatch" /> method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the <see cref="Overload:System.Text.RegularExpressions.Regex.Match" /> or <see cref="Overload:System.Text.RegularExpressions.Regex.Matches" /> method.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Indicates whether the regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor finds a match in a specified input string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the regular expression finds a match; otherwise, false.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="IsMatch">
|
||
<MemberSignature Language="C#" Value="public bool IsMatch (string input, int startat);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance bool IsMatch(string input, int32 startat) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="startat" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="Overload:System.Text.RegularExpressions.Regex.IsMatch" /> method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the <see cref="Overload:System.Text.RegularExpressions.Regex.Match" /> or <see cref="Overload:System.Text.RegularExpressions.Regex.Matches" /> method.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Indicates whether the regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor finds a match in the specified input string, beginning at the specified starting position in the string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the regular expression finds a match; otherwise, false.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="startat">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The character position at which to start the search. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="IsMatch">
|
||
<MemberSignature Language="C#" Value="public static bool IsMatch (string input, string pattern);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsMatch(string input, string pattern) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="Overload:System.Text.RegularExpressions.Regex.IsMatch" /> method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the <see cref="Overload:System.Text.RegularExpressions.Regex.Match" /> or <see cref="Overload:System.Text.RegularExpressions.Regex.Matches" /> method.</para>
|
||
<para>The static <see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String,System.String)" /> method is equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the regular expression pattern specified by <paramref name="pattern" /> and calling the <see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String)" /> instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Indicates whether the specified regular expression finds a match in the specified input string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the regular expression finds a match; otherwise, false.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="IsMatch">
|
||
<MemberSignature Language="C#" Value="public static bool IsMatch (string input, string pattern, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsMatch(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="Overload:System.Text.RegularExpressions.Regex.IsMatch" /> method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the <see cref="Overload:System.Text.RegularExpressions.Regex.Match" /> or <see cref="Overload:System.Text.RegularExpressions.Regex.Matches" /> method.</para>
|
||
<para>The static <see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method is equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the regular expression pattern specified by <paramref name="pattern" /> and the regular expression options specified by <paramref name="options" /> and calling the <see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String)" /> instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Indicates whether the specified regular expression finds a match in the specified input string, using the specified matching options.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the regular expression finds a match; otherwise, false.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="IsMatch">
|
||
<MemberSignature Language="C#" Value="public static bool IsMatch (string input, string pattern, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsMatch(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="Overload:System.Text.RegularExpressions.Regex.IsMatch" /> method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the <see cref="Overload:System.Text.RegularExpressions.Regex.Match" /> or <see cref="Overload:System.Text.RegularExpressions.Regex.Matches" /> method.</para>
|
||
<para>The static <see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> method is equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the regular expression pattern specified by <paramref name="pattern" /> and the regular expression options specified by <paramref name="options" /> and calling the <see cref="M:System.Text.RegularExpressions.Regex.IsMatch(System.String)" /> instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <paramref name="matchTimeout" /> parameter specifies how long a pattern matching method should try to find a match before it times out. Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to stop responding when they process input that contains near matches. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format> and <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>. If no match is found in that time interval, the method throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. <paramref name="matchTimeout" /> overrides any default time-out value defined for the application domain in which the method executes. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Indicates whether the specified regular expression finds a match in the specified input string, using the specified matching options and time-out interval.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the regular expression finds a match; otherwise, false.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match.</param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Match">
|
||
<MemberSignature Language="C#" Value="public System.Text.RegularExpressions.Match Match (string input);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Text.RegularExpressions.Match Match(string input) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.Match</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String)" /> method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language - Quick Reference</a></format>.</para>
|
||
<para>You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Group.Success" /> property. If a match is found, the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Capture.Value" /> property contains the substring from <paramref name="input" /> that matches the regular expression pattern. If no match is found, its value is <see cref="F:System.String.Empty" />.</para>
|
||
<para>This method returns the first substring in <paramref name="input" /> that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method. You can also retrieve all matches in a single method call by calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for the first occurrence of the regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An object that contains information about the match.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Match">
|
||
<MemberSignature Language="C#" Value="public System.Text.RegularExpressions.Match Match (string input, int startat);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Text.RegularExpressions.Match Match(string input, int32 startat) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.Match</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="startat" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.Int32)" /> method returns the first substring that matches a regular expression pattern, starting at or after the <paramref name="startat" /> character position, in an input string. For information about the language elements used to build a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language - Quick Reference</a></format>.</para>
|
||
<para>The regular expression pattern for which the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.Int32)" /> method searches is defined by the call to one of the <see cref="T:System.Text.RegularExpressions.Regex" /> class constructors. For more information about the elements that can form a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>You can optionally specify a starting position in the string by using the <paramref name="startat" /> parameter. When the regular expression engine parses from left to right (the default), the match and the scan move rightward, starting at the character specified in <paramref name="startat" />. When the regular expression engine parses from right to left (when the regular expression pattern is constructed with the <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> option), the match and scan move in the opposite direction and begin with the character at <paramref name="startat" /> -1. If you do not specify a starting position, the search begins at the default <paramref name="startat" /> position. If the regular expression searches from left to right, the default <paramref name="startat" /> position is at the left end of <paramref name="input" />; if it searches from right to left, the default <paramref name="startat" /> position is at the right end of <paramref name="input" />.</para>
|
||
<para>If you want to restrict a match so that it begins at a particular character position in the string and the regular expression engine does not scan the remainder of the string for a match, anchor the regular expression with a \G (at the left for a left-to-right pattern, or at the right for a right-to-left pattern). This restricts the match so it must start exactly at <paramref name="startat" />.</para>
|
||
<para>You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Group.Success" /> property. If a match is found, the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Capture.Value" /> property contains the substring from <paramref name="input" /> that matches the regular expression pattern. If no match is found, its value is <see cref="F:System.String.Empty" />.</para>
|
||
<para>This method returns the first substring found at or after the <paramref name="startat" /> character position in <paramref name="input" /> that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method. You can also retrieve all matches in a single method call by calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exeeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position in the string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An object that contains information about the match.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="startat">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The zero-based character position at which to start the search. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Match">
|
||
<MemberSignature Language="C#" Value="public static System.Text.RegularExpressions.Match Match (string input, string pattern);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Text.RegularExpressions.Match Match(string input, string pattern) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.Match</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String)" /> method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language - Quick Reference</a></format>.</para>
|
||
<para>The static <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String)" /> method is equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String)" /> method. In this case, the regular expression engine caches the regular expression pattern.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Group.Success" /> property. If a match is found, the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Capture.Value" /> property contains the substring from <paramref name="input" /> that matches the regular expression pattern. If no match is found, its value is <see cref="F:System.String.Empty" />.</para>
|
||
<para>This method returns the first substring in <paramref name="input" /> that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method. You can also retrieve all matches in a single method call by calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String)" /> method.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for the first occurrence of the specified regular expression.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An object that contains information about the match.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Match">
|
||
<MemberSignature Language="C#" Value="public System.Text.RegularExpressions.Match Match (string input, int beginning, int length);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Text.RegularExpressions.Match Match(string input, int32 beginning, int32 length) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.Match</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="beginning" Type="System.Int32" />
|
||
<Parameter Name="length" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.Int32,System.Int32)" /> method returns the first substring that matches a regular expression pattern in a portion of an input string. For information about the language elements used to build a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language - Quick Reference</a></format>.</para>
|
||
<para>The regular expression pattern for which the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.Int32,System.Int32)" /> method searches is defined by the call to one of the <see cref="T:System.Text.RegularExpressions.Regex" /> class constructors. For more information about the elements that can form a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.Int32,System.Int32)" /> method searches the portion of <paramref name="input" /> defined by the <paramref name="beginning" /> and <paramref name="length" /> parameters for the regular expression pattern. <paramref name="beginning" /> always defines the index of the leftmost character to include in the search, and <paramref name="length" /> defines the maximum number of characters to search. Together, they define the range of the search. If the search proceeds from left to right (the default), the regular expression engine searches from the character at index <paramref name="beginning" /> to the character at index <paramref name="beginning" /> + <paramref name="length" /> – 1. If the regular expression engine was instantiated by using the <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> option so that the search proceeds from right to left, the regular expression engine searches from the character at index <paramref name="beginning" /> + <paramref name="length" /> – 1 to the character at index <paramref name="beginning" />. This method returns the first match that it finds within this range. You can retrieve subsequent matches by repeatedly calling the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method.</para>
|
||
<para>You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Group.Success" /> property. If a match is found, the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Capture.Value" /> property contains the substring from <paramref name="input" /> that matches the regular expression pattern. If no match is found, its value is <see cref="F:System.String.Empty" />.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out value when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position and searching only the specified number of characters.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An object that contains information about the match.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="beginning">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The zero-based character position in the input string that defines the leftmost position to be searched. </param>
|
||
<param name="length">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The number of characters in the substring to include in the search. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Match">
|
||
<MemberSignature Language="C#" Value="public static System.Text.RegularExpressions.Match Match (string input, string pattern, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Text.RegularExpressions.Match Match(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.Match</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language - Quick Reference</a></format>.</para>
|
||
<para>The static <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method is equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions)" /> constructor and calling the instance <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String)" /> method. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Group.Success" /> property. If a match is found, the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Capture.Value" /> property contains the substring from <paramref name="input" /> that matches the regular expression pattern. If no match is found, its value is <see cref="F:System.String.Empty" />.</para>
|
||
<para>This method returns the first substring found in <paramref name="input" /> that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method. You can also retrieve all matches in a single method call by calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the input string for the first occurrence of the specified regular expression, using the specified matching options.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An object that contains information about the match.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Match">
|
||
<MemberSignature Language="C#" Value="public static System.Text.RegularExpressions.Match Match (string input, string pattern, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Text.RegularExpressions.Match Match(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.Match</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language - Quick Reference</a></format>.</para>
|
||
<para>The static <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> method is equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor and calling the instance <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String)" /> method.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Group.Success" /> property. If a match is found, the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="P:System.Text.RegularExpressions.Capture.Value" /> property contains the substring from <paramref name="input" /> that matches the regular expression pattern. If no match is found, its value is <see cref="F:System.String.Empty" />.</para>
|
||
<para>This method returns the first substring found in <paramref name="input" /> that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned <see cref="T:System.Text.RegularExpressions.Match" /> object's <see cref="M:System.Text.RegularExpressions.Match.NextMatch" /> method. You can also retrieve all matches in a single method call by calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method.</para>
|
||
<para>The <paramref name="matchTimeout" /> parameter specifies how long a pattern matching method should try to find a match before it times out. Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to stop responding when they process input that contains near matches. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format> and <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>. If no match is found in that time interval, the method throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. <paramref name="matchTimeout" /> overrides any default time-out value defined for the application domain in which the method executes. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the input string for the first occurrence of the specified regular expression, using the specified matching options and time-out interval.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An object that contains information about the match.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match.</param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Matches">
|
||
<MemberSignature Language="C#" Value="public System.Text.RegularExpressions.MatchCollection Matches (string input);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Text.RegularExpressions.MatchCollection Matches(string input) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.MatchCollection</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method is similar to the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String)" /> method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Matches#5</para>
|
||
<para>The collection includes only matches and terminates at the first non-match.</para>
|
||
<para>The regular expression pattern for which the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method searches is defined by the call to one of the <see cref="T:System.Text.RegularExpressions.Regex" /> class constructors. For more information about the elements that can form a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method uses lazy evaluation to populate the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object. Accessing members of this collection such as <see cref="P:System.Text.RegularExpressions.MatchCollection.Count" /> and <see cref="M:System.Text.RegularExpressions.MatchCollection.CopyTo(System.Array,System.Int32)" /> causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as foreach in C# and For Each…Next in Visual Basic.</para>
|
||
<para>Because of its lazy evaluation, calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method does not throw a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. However, the exception is thrown when an operation is performed on the <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object returned by this method, if the <see cref="P:System.Text.RegularExpressions.Regex.MatchTimeout" /> property is not <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> and a matching operation exceeds the time-out interval.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for all occurrences of a regular expression.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Matches">
|
||
<MemberSignature Language="C#" Value="public System.Text.RegularExpressions.MatchCollection Matches (string input, int startat);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.Text.RegularExpressions.MatchCollection Matches(string input, int32 startat) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.MatchCollection</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="startat" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method is similar to the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.Int32)" /> method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code:</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Matches#6</para>
|
||
<para>The regular expression pattern for which the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method searches is defined by the call to one of the <see cref="T:System.Text.RegularExpressions.Regex" /> class constructors. For more information about the elements that can form a regular expression pattern, see <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method uses lazy evaluation to populate the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object. Accessing members of this collection such as <see cref="P:System.Text.RegularExpressions.MatchCollection.Count" /> and <see cref="M:System.Text.RegularExpressions.MatchCollection.CopyTo(System.Array,System.Int32)" /> causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as foreach in C# and For Each…Next in Visual Basic.</para>
|
||
<para>Because of its lazy evaluation, calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method does not throw a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. However, the exception is thrown when an operation is performed on the <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object returned by this method, if the <see cref="P:System.Text.RegularExpressions.Regex.MatchTimeout" /> property is not <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> and a matching operation exceeds the time-out interval..</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for all occurrences of a regular expression, beginning at the specified starting position in the string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="startat">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The character position in the input string at which to start the search. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Matches">
|
||
<MemberSignature Language="C#" Value="public static System.Text.RegularExpressions.MatchCollection Matches (string input, string pattern);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Text.RegularExpressions.MatchCollection Matches(string input, string pattern) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.MatchCollection</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String)" /> method is similar to the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String)" /> method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Matches#7</para>
|
||
<para>The static Matches methods are equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance method Matches. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method uses lazy evaluation to populate the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object. Accessing members of this collection such as <see cref="P:System.Text.RegularExpressions.MatchCollection.Count" /> and <see cref="M:System.Text.RegularExpressions.MatchCollection.CopyTo(System.Array,System.Int32)" /> causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as foreach in C# and For Each…Next in Visual Basic.</para>
|
||
<para>Because of its lazy evaluation, calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String)" /> method does not throw a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. However, the exception is thrown when an operation is performed on the <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object returned by this method, if a time-out interval is defined by the "REGEX_DEFAULT_MATCH_TIMEOUT" property of the current application domain and a matching operation exceeds this time-out interval.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for all occurrences of a specified regular expression.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Matches">
|
||
<MemberSignature Language="C#" Value="public static System.Text.RegularExpressions.MatchCollection Matches (string input, string pattern, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Text.RegularExpressions.MatchCollection Matches(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.MatchCollection</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method is similar to the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code:</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Matches#8</para>
|
||
<para>The static Matches methods are equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance method Matches. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method uses lazy evaluation to populate the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object. Accessing members of this collection such as <see cref="P:System.Text.RegularExpressions.MatchCollection.Count" /> and <see cref="M:System.Text.RegularExpressions.MatchCollection.CopyTo(System.Array,System.Int32)" /> causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as foreach in C# and For Each…Next in Visual Basic.</para>
|
||
<para>Because of its lazy evaluation, calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String)" /> method does not throw a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. However, the exception is thrown when an operation is performed on the <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object returned by this method, if a time-out interval is defined by the "REGEX_DEFAULT_MATCH_TIMEOUT" property of the current application domain and a matching operation exceeds this time-out interval.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for all occurrences of a specified regular expression, using the specified matching options.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that specify options for matching. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Matches">
|
||
<MemberSignature Language="C#" Value="public static System.Text.RegularExpressions.MatchCollection Matches (string input, string pattern, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Text.RegularExpressions.MatchCollection Matches(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.MatchCollection</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> method is similar to the <see cref="M:System.Text.RegularExpressions.Regex.Match(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code:</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Matches#10</para>
|
||
<para>The static Matches methods are equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance method Matches. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method uses lazy evaluation to populate the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object. Accessing members of this collection such as <see cref="P:System.Text.RegularExpressions.MatchCollection.Count" /> and <see cref="M:System.Text.RegularExpressions.MatchCollection.CopyTo(System.Array,System.Int32)" /> causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as foreach in C# and For Each…Next in Visual Basic.</para>
|
||
<para>Because of its lazy evaluation, calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> method does not throw a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. However, an exception is thrown when an operation is performed on the <see cref="T:System.Text.RegularExpressions.MatchCollection" /> object returned by this method, if a matching operation exceeds this time-out interval specified by the<paramref name="matchTimeout" /> parameter.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Searches the specified input string for all occurrences of a specified regular expression, using the specified matching options and time-out interval.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A collection of the <see cref="T:System.Text.RegularExpressions.Match" /> objects found by the search. If no matches are found, the method returns an empty collection object.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match.</param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that specify options for matching.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="MatchTimeout">
|
||
<MemberSignature Language="C#" Value="public TimeSpan MatchTimeout { get; }" />
|
||
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.TimeSpan MatchTimeout" />
|
||
<MemberType>Property</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.TimeSpan</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<value>To be added.</value>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="P:System.Text.RegularExpressions.Regex.MatchTimeout" /> property defines the approximate maximum time interval for a <see cref="T:System.Text.RegularExpressions.Regex" /> instance to execute a single matching operation before the operation times out. The regular expression engine throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception during its next timing check after the time-out interval has elapsed. This prevents the regular expression engine from processing input strings that require excessive backtracking. For more information, see <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format> and <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format>.</para>
|
||
<para>This property is read-only. You can set its value explicitly for an individual <see cref="T:System.Text.RegularExpressions.Regex" /> object by calling the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor; and you can set its value for all <see cref="T:System.Text.RegularExpressions.Regex" /> matching operations in an application domain by calling the <see cref="M:System.AppDomain.SetData(System.String,System.Object)" /> method and providing a value for the "REGEX_DEFAULT_MATCH_TIMEOUT" property. If you do not explicitly set a time-out interval, the default value <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> is used, and matching operations do not time out. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Gets the time-out interval of the current instance.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Options">
|
||
<MemberSignature Language="C#" Value="public System.Text.RegularExpressions.RegexOptions Options { get; }" />
|
||
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Text.RegularExpressions.RegexOptions Options" />
|
||
<MemberType>Property</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.RegexOptions</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<value>To be added: an object of type 'RegexOptions'</value>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The value of the <see cref="P:System.Text.RegularExpressions.Regex.Options" /> property consists of one or more members of the <see cref="T:System.Text.RegularExpressions.RegexOptions" /> enumeration. If no options were defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> class constructor, its value is <see cref="F:System.Text.RegularExpressions.RegexOptions.None" />. The available options are discussed in detail in the <format type="text/html"><a href="c82dc689-7e82-4767-a18d-cd24ce5f05e9">Regular Expression Options</a></format> topic.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Gets the options that were passed into the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="pattern">
|
||
<MemberSignature Language="C#" Value="protected string pattern;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly string pattern" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public string Replace (string input, string replacement);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string Replace(string input, string replacement) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="replacement" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The search for matches starts at the beginning of the <paramref name="input" /> string. The regular expression is the pattern defined by the constructor for the current <see cref="T:System.Text.RegularExpressions.Regex" /> object.</para>
|
||
<para>The <paramref name="replacement" /> parameter specifies the string that is to replace each match in <paramref name="input" />. <paramref name="replacement" /> can consist of any combination of literal text and <format type="text/html"><a href="d1f52431-1c7d-4dc6-8792-6b988256892e">substitutions</a></format>. For example, the replacement pattern a*${test}b inserts the string "a*" followed by the substring that is matched by the test capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern.</para>
|
||
<block subset="none" type="note">
|
||
<para>Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including <format type="text/html"><a href="f49cc9cc-db7d-4058-8b8a-422bc08b29b0">character escapes</a></format>, are allowed in regular expression patterns only and are not recognized in replacement patterns.</para>
|
||
</block>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a regular expression pattern with a specified replacement string. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="replacement">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The replacement string. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public string Replace (string input, System.Text.RegularExpressions.MatchEvaluator evaluator);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string Replace(string input, class System.Text.RegularExpressions.MatchEvaluator evaluator) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="evaluator" Type="System.Text.RegularExpressions.MatchEvaluator" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator)" /> method is useful for replacing a regular expression match if any of the following conditions is true:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The replacement string cannot readily be specified by a regular expression replacement pattern.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from some processing done on the matched string.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from conditional processing.</para>
|
||
</item>
|
||
</list>
|
||
<para>The method is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method and passing each <see cref="T:System.Text.RegularExpressions.Match" /> object in the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> collection to the <paramref name="evaluator" /> delegate.</para>
|
||
<para>The regular expression is the pattern defined by the constructor for the current <see cref="T:System.Text.RegularExpressions.Regex" /> object. </para>
|
||
<para>The <paramref name="evaluator" /> parameter is the delegate for a custom method that you define and that examines each match. The custom method must have the following signature to match the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Replace#1</para>
|
||
<para>Your custom method returns a string that replaces the matched input. </para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="evaluator">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public string Replace (string input, string replacement, int count);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string Replace(string input, string replacement, int32 count) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="replacement" Type="System.String" />
|
||
<Parameter Name="count" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The search for matches starts at the beginning of the <paramref name="input" /> string. The regular expression is the pattern that is defined by the constructor for the current <see cref="T:System.Text.RegularExpressions.Regex" /> object. If <paramref name="count" /> is negative, replacements continue to the end of the string. If <paramref name="count" /> exceeds the number of matches, all matches are replaced.</para>
|
||
<para>The <paramref name="replacement" /> parameter specifies the string that is to replace the first <paramref name="count" /> matches in <paramref name="input" />. <paramref name="replacement" /> can consist of any combination of literal text and <format type="text/html"><a href="d1f52431-1c7d-4dc6-8792-6b988256892e">substitutions</a></format>. For example, the replacement pattern a*${test}b inserts the string "a*" followed by the substring that is matched by the test capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern.</para>
|
||
<block subset="none" type="note">
|
||
<para>Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including <format type="text/html"><a href="f49cc9cc-db7d-4058-8b8a-422bc08b29b0">character escapes</a></format>, are allowed in regular expression patterns only and are not recognized in replacement patterns.</para>
|
||
</block>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="replacement">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The replacement string. </param>
|
||
<param name="count">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of times the replacement can occur. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public static string Replace (string input, string pattern, string replacement);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Replace(string input, string pattern, string replacement) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="replacement" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The static Replace methods are equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance method Replace. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>. The search for matches starts at the beginning of the <paramref name="input" /> string.</para>
|
||
<para>The <paramref name="replacement" /> parameter specifies the string that is to replace each match in <paramref name="input" />. <paramref name="replacement" /> can consist of any combination of literal text and <format type="text/html"><a href="d1f52431-1c7d-4dc6-8792-6b988256892e">substitutions</a></format>. For example, the replacement pattern a*${test}b inserts the string "a*" followed by the substring that is matched by the test capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern.</para>
|
||
<block subset="none" type="note">
|
||
<para>Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including <format type="text/html"><a href="f49cc9cc-db7d-4058-8b8a-422bc08b29b0">character escapes</a></format>, are allowed in regular expression patterns only and are not recognized in replacement patterns.</para>
|
||
</block>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If <paramref name="pattern" /> is not matched in the current instance, the method returns the current instance unchanged.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="replacement">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The replacement string. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public static string Replace (string input, string pattern, System.Text.RegularExpressions.MatchEvaluator evaluator);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Replace(string input, string pattern, class System.Text.RegularExpressions.MatchEvaluator evaluator) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="evaluator" Type="System.Text.RegularExpressions.MatchEvaluator" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.String,System.Text.RegularExpressions.MatchEvaluator)" /> method is useful for replacing a regular expression match if any of the following conditions is true:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The replacement string cannot readily be specified by a regular expression replacement pattern.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from some processing done on the matched string.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from conditional processing.</para>
|
||
</item>
|
||
</list>
|
||
<para>The method is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String)" /> method and passing each <see cref="T:System.Text.RegularExpressions.Match" /> object in the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> collection to the <paramref name="evaluator" /> delegate.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <paramref name="evaluator" /> parameter is the delegate for a custom method that you define and that examines each match. The custom method must have the following signature to match the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Replace#1</para>
|
||
<para>Your custom method returns a string that replaces the matched input. </para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If <paramref name="pattern" /> is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="evaluator">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public string Replace (string input, System.Text.RegularExpressions.MatchEvaluator evaluator, int count);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string Replace(string input, class System.Text.RegularExpressions.MatchEvaluator evaluator, int32 count) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="evaluator" Type="System.Text.RegularExpressions.MatchEvaluator" />
|
||
<Parameter Name="count" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator,System.Int32)" /> method is useful for replacing a regular expression match if any of the following conditions is true:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The replacement string cannot readily be specified by a regular expression replacement pattern.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from some processing done on the matched string.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from conditional processing.</para>
|
||
</item>
|
||
</list>
|
||
<para>The method is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String)" /> method and passing the first <paramref name="count" /> <see cref="T:System.Text.RegularExpressions.Match" /> objects in the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> collection to the <paramref name="evaluator" /> delegate.</para>
|
||
<para>The regular expression is the pattern defined by the constructor for the current <see cref="T:System.Text.RegularExpressions.Regex" /> object. </para>
|
||
<para>The <paramref name="evaluator" /> parameter is the delegate for a custom method that you define and that examines each match. The custom method must have the following signature to match the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Replace#1</para>
|
||
<para>Your custom method returns a string that replaces the matched input. </para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="evaluator">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||
<param name="count">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of times the replacement will occur. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public string Replace (string input, string replacement, int count, int startat);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string Replace(string input, string replacement, int32 count, int32 startat) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="replacement" Type="System.String" />
|
||
<Parameter Name="count" Type="System.Int32" />
|
||
<Parameter Name="startat" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The search for matches starts in the <paramref name="input" /> string at the position specified by the <paramref name="startat" /> parameter. The regular expression is the pattern defined by the constructor for the current <see cref="T:System.Text.RegularExpressions.Regex" /> object. If <paramref name="count" /> is negative, replacements continue to the end of the string. If <paramref name="count" /> exceeds the number of matches, all matches are replaced.</para>
|
||
<para>The <paramref name="replacement" /> parameter specifies the string that is to replace each match in <paramref name="input" />. <paramref name="replacement" /> can consist of any combination of literal text and <format type="text/html"><a href="d1f52431-1c7d-4dc6-8792-6b988256892e">substitutions</a></format>. For example, the replacement pattern a*${test}b inserts the string "a*" followed by the substring that is matched by the test capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern.</para>
|
||
<block subset="none" type="note">
|
||
<para>Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including <format type="text/html"><a href="f49cc9cc-db7d-4058-8b8a-422bc08b29b0">character escapes</a></format>, are allowed in regular expression patterns only and are not recognized in replacement patterns.</para>
|
||
</block>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input substring, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="replacement">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The replacement string. </param>
|
||
<param name="count">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />Maximum number of times the replacement can occur. </param>
|
||
<param name="startat">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The character position in the input string where the search begins. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public static string Replace (string input, string pattern, string replacement, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Replace(string input, string pattern, string replacement, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="replacement" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The static Replace methods are equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance method Replace. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>. If you specify <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> for the <paramref name="options" /> parameter, the search for matches begins at the end of the input string and moves left; otherwise, the search begins at the start of the input string and moves right. </para>
|
||
<para>The <paramref name="replacement" /> parameter specifies the string that is to replace each match in <paramref name="input" />. <paramref name="replacement" /> can consist of any combination of literal text and <format type="text/html"><a href="d1f52431-1c7d-4dc6-8792-6b988256892e">substitutions</a></format>. For example, the replacement pattern a*${test}b inserts the string "a*" followed by the substring that is matched by the test capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern.</para>
|
||
<block subset="none" type="note">
|
||
<para>Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including <format type="text/html"><a href="f49cc9cc-db7d-4058-8b8a-422bc08b29b0">character escapes</a></format>, are allowed in regular expression patterns only and are not recognized in replacement patterns.</para>
|
||
</block>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Specified options modify the matching operation. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If <paramref name="pattern" /> is not matched in the current instance, the method returns the current instance unchanged.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="replacement">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The replacement string. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public static string Replace (string input, string pattern, System.Text.RegularExpressions.MatchEvaluator evaluator, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Replace(string input, string pattern, class System.Text.RegularExpressions.MatchEvaluator evaluator, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="evaluator" Type="System.Text.RegularExpressions.MatchEvaluator" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.String,System.Text.RegularExpressions.MatchEvaluator,System.Text.RegularExpressions.RegexOptions)" /> method is useful for replacing a regular expression match in if any of the following conditions is true:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The replacement string cannot readily be specified by a regular expression replacement pattern.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from some processing done on the matched string.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from conditional processing.</para>
|
||
</item>
|
||
</list>
|
||
<para>The method is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method and passing each <see cref="T:System.Text.RegularExpressions.Match" /> object in the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> collection to the <paramref name="evaluator" /> delegate.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <paramref name="evaluator" /> parameter is the delegate for a custom method that you define and that examines each match. The custom method must have the following signature to match the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Replace#1</para>
|
||
<para>Your custom method returns a string that replaces the matched input. </para>
|
||
<para>If you specify <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> for the <paramref name="options" /> parameter, the search for matches begins at the end of the input string and moves left; otherwise, the search begins at the start of the input string and moves right. </para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown.</para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. Specified options modify the matching operation.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If <paramref name="pattern" /> is not matched in the current instance, the method returns the current instance unchanged.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="evaluator">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A custom method that examines each match and returns either the original matched string or a replacement string. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public string Replace (string input, System.Text.RegularExpressions.MatchEvaluator evaluator, int count, int startat);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string Replace(string input, class System.Text.RegularExpressions.MatchEvaluator evaluator, int32 count, int32 startat) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="evaluator" Type="System.Text.RegularExpressions.MatchEvaluator" />
|
||
<Parameter Name="count" Type="System.Int32" />
|
||
<Parameter Name="startat" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.Text.RegularExpressions.MatchEvaluator,System.Int32,System.Int32)" /> method is useful for replacing a regular expression match if any of the following conditions is true:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>The replacement string cannot readily be specified by a regular expression replacement pattern.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from some processing done on the matched string.</para>
|
||
</item>
|
||
<item>
|
||
<para>The replacement string results from conditional processing.</para>
|
||
</item>
|
||
</list>
|
||
<para>The method is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.Int32)" /> method and passing the first <paramref name="count" /> <see cref="T:System.Text.RegularExpressions.Match" /> objects in the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> collection to the <paramref name="evaluator" /> delegate.</para>
|
||
<para>The regular expression is the pattern defined by the constructor for the current <see cref="T:System.Text.RegularExpressions.Regex" /> object. </para>
|
||
<para>The <paramref name="evaluator" /> parameter is the delegate for a custom method that you define and that examines each match. The custom method must have the following signature to match the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Replace#1</para>
|
||
<para>Your custom method returns a string that replaces the matched input. </para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input substring, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match. </param>
|
||
<param name="evaluator">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||
<param name="count">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of times the replacement will occur. </param>
|
||
<param name="startat">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The character position in the input string where the search begins. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public static string Replace (string input, string pattern, string replacement, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Replace(string input, string pattern, string replacement, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="replacement" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The static Replace methods are equivalent to constructing a <see cref="T:System.Text.RegularExpressions.Regex" /> object with the specified regular expression pattern and calling the instance method Replace. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>. If you specify <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> for the <paramref name="options" /> parameter, the search for matches begins at the end of the input string and moves left; otherwise, the search begins at the start of the input string and moves right. </para>
|
||
<para>The <paramref name="replacement" /> parameter specifies the string that is to replace each match in <paramref name="input" />. <paramref name="replacement" /> can consist of any combination of literal text and <format type="text/html"><a href="d1f52431-1c7d-4dc6-8792-6b988256892e">substitutions</a></format>. For example, the replacement pattern a*${test}b inserts the string "a*" followed by the substring that is matched by the test capturing group, if any, followed by the string "b". The * character is not recognized as a metacharacter within a replacement pattern.</para>
|
||
<block subset="none" type="note">
|
||
<para>Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including <format type="text/html"><a href="f49cc9cc-db7d-4058-8b8a-422bc08b29b0">character escapes</a></format>, are allowed in regular expression patterns only and are not recognized in replacement patterns.</para>
|
||
</block>
|
||
<para>The <paramref name="matchTimeout" /> parameter specifies how long a pattern matching method should try to find a match before it times out. Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to stop responding when they process input that contains near matches. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format> and <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>. If no match is found in that time interval, the method throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. <paramref name="matchTimeout" /> overrides any default time-out value defined for the application domain in which the method executes. </para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Additional parameters specify options that modify the matching operation and a time-out interval if no match is found.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If <paramref name="pattern" /> is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match.</param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="replacement">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The replacement string.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Replace">
|
||
<MemberSignature Language="C#" Value="public static string Replace (string input, string pattern, System.Text.RegularExpressions.MatchEvaluator evaluator, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Replace(string input, string pattern, class System.Text.RegularExpressions.MatchEvaluator evaluator, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="evaluator" Type="System.Text.RegularExpressions.MatchEvaluator" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Replace(System.String,System.String,System.Text.RegularExpressions.MatchEvaluator,System.Text.RegularExpressions.RegexOptions)" /> method is useful for replacing a regular expression match if any of the following conditions is true:</para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>If the replacement string cannot readily be specified by a regular expression replacement pattern.</para>
|
||
</item>
|
||
<item>
|
||
<para>If the replacement string results from some processing performed on the matched string.</para>
|
||
</item>
|
||
<item>
|
||
<para>If the replacement string results from conditional processing.</para>
|
||
</item>
|
||
</list>
|
||
<para>The method is equivalent to calling the <see cref="M:System.Text.RegularExpressions.Regex.Matches(System.String,System.String,System.Text.RegularExpressions.RegexOptions)" /> method and passing each <see cref="T:System.Text.RegularExpressions.Match" /> object in the returned <see cref="T:System.Text.RegularExpressions.MatchCollection" /> collection to the <paramref name="evaluator" /> delegate.</para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<para>The <paramref name="evaluator" /> parameter is the delegate for a custom method that you define and that examines each match. The custom method must have the following signature to match the <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Replace#1</para>
|
||
<para>Your custom method returns a string that replaces the matched input. </para>
|
||
<para>If you specify <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> for the <paramref name="options" /> parameter, the search for matches begins at the end of the input string and moves left; otherwise, the search begins at the start of the input string and moves right. </para>
|
||
<para>The <paramref name="matchTimeout" /> parameter specifies how long a pattern matching method should try to find a match before it times out. Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to "stop responding when they process input that contains near matches. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format> and <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>. If no match is found in that time interval, the method throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. <paramref name="matchTimeout" /> overrides any default time-out value defined for the application domain in which the method executes.</para>
|
||
<para>Because the method returns <paramref name="input" /> unchanged if there is no match, you can use the <see cref="M:System.Object.ReferenceEquals(System.Object,System.Object)" /> method to determine whether the method has made any replacements to the input string. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>In a specified input string, replaces all substrings that match a specified regular expression with a string returned by a <see cref="T:System.Text.RegularExpressions.MatchEvaluator" /> delegate. Additional parameters specify options that modify the matching operation and a time-out interval if no match is found.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If <paramref name="pattern" /> is not matched in the current instance, the method returns the current instance unchanged. </para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to search for a match.</param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="evaluator">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A custom method that examines each match and returns either the original matched string or a replacement string.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of enumeration values that provide options for matching.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="RightToLeft">
|
||
<MemberSignature Language="C#" Value="public bool RightToLeft { get; }" />
|
||
<MemberSignature Language="ILAsm" Value=".property instance bool RightToLeft" />
|
||
<MemberType>Property</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<value>To be added: an object of type 'bool'</value>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>
|
||
<see cref="P:System.Text.RegularExpressions.Regex.RightToLeft" /> is true if the <see cref="T:System.Text.RegularExpressions.Regex" /> instance was created with the <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> option.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Gets a value that indicates whether the regular expression searches from right to left.</para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="roptions">
|
||
<MemberSignature Language="C#" Value="protected System.Text.RegularExpressions.RegexOptions roptions;" />
|
||
<MemberSignature Language="ILAsm" Value=".field familyorassembly valuetype System.Text.RegularExpressions.RegexOptions roptions" />
|
||
<MemberType>Field</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Text.RegularExpressions.RegexOptions</ReturnType>
|
||
</ReturnValue>
|
||
<Docs>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method. </para>
|
||
</summary>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Split">
|
||
<MemberSignature Language="C#" Value="public string[] Split (string input);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] Split(string input) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are similar to the <see cref="M:System.String.Split(System.Char[])" /> method, except that <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original input string. </para>
|
||
<para>If multiple matches are adjacent to one another, an empty string is inserted into the array. For example, splitting a string on a single hyphen causes the returned array to include an empty string in the position where two adjacent hyphens are found, as the following code shows.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#1</para>
|
||
<para>If a match is found at the beginning or the end of the input string, an empty string is included at the beginning or the end of the returned array. The following example uses the regular expression pattern \d+ to split an input string on numeric characters. Because the string begins and ends with matching numeric characters, the value of the first and last element of the returned array is <see cref="F:System.String.Empty" />.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#21</para>
|
||
<para>If capturing parentheses are used in a <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> expression, any captured text is included in the resulting string array. For example, if you split the string "plum-pear" on a hyphen placed within capturing parentheses, the returned array includes a string element that contains the hyphen.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#2</para>
|
||
<para>However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, if a match is not found within the first set of capturing parentheses, captured text from additional capturing parentheses is not included in the returned array. Starting with the .NET Framework 2.0, all captured text is also added to the returned array. For example, the following code uses two sets of capturing parentheses to extract the elements of a date, including the date delimiters, from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, it excludes the slash characters; if it is compiled and run under the .NET Framework 2.0 or later versions, it includes them.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#3</para>
|
||
<para>If the regular expression can match the empty string, <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> will split the string into an array of single-character strings because the empty string delimiter can be found at every location. For example:</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#11</para>
|
||
<para>Note that the returned array also includes an empty string at the beginning and end of the array.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Splits an input string into an array of substrings at the positions defined by a regular expression pattern specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An array of strings.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to split. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Split">
|
||
<MemberSignature Language="C#" Value="public string[] Split (string input, int count);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] Split(string input, int32 count) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="count" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are similar to the <see cref="M:System.String.Split(System.Char[])" /> method, except that <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> splits the string at a delimiter determined by a regular expression instead of a set of characters. The <paramref name="count" /> parameter specifies the maximum number of substrings into which the <paramref name="input" /> string can be split; the last string contains the unsplit remainder of the string. A <paramref name="count" /> value of zero provides the default behavior of splitting as many times as possible. </para>
|
||
<para>If multiple matches are adjacent to one another or if a match is found at the beginning or end of <paramref name="input" />, and the number of matches found is at least two less than <paramref name="count" />, an empty string is inserted into the array. That is, empty strings that result from adjacent matches or from matches at the beginning or end of the input string are counted in determining whether the number of matched substrings equals <paramref name="count" />. In the following example, the regular expression /d+ is used to split an input string that includes one or more decimal digits into a maximum of three substrings. Because the beginning of the input string matches the regular expression pattern, the first array element contains <see cref="F:System.String.Empty" />, the second contains the first set of alphabetic characters in the input string, and the third contains the remainder of the string that follows the third match. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#25</para>
|
||
<para>If capturing parentheses are used in a regular expression, any captured text is included in the array of split strings. However, any array elements that contain captured text are not counted in determining whether the number of matches has reached <paramref name="count" />. For example, splitting the string "apple-apricot-plum-pear-banana" into a maximum of four substrings results in a seven-element array, as the following code shows. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#4</para>
|
||
<para>However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, only captured text from the first set of capturing parentheses is included in the returned array. Starting with the .NET Framework 2.0, all captured text is added to the returned array. However, elements in the returned array that contain captured text are not counted in determining whether the number of matched substrings equals <paramref name="count" />. For example, in the following code, a regular expression uses two sets of capturing parentheses to extract the elements of a date from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. The call to the <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String,System.Int32)" /> method then specifies a maximum of two elements in the returned array. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, the method returns a two-element string array. If it is compiled and run under the .NET Framework 2.0 or later versions, the method returns a three-element string array.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#5</para>
|
||
<para>If the regular expression can match the empty string, <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String,System.Int32)" /> will split the string into an array of single-character strings because the empty string delimiter can be found at every location. The following example splits the string "characters" into as many elements as there are in the input string. Because the null string matches the beginning of the input string, a null string is inserted at the beginning of the returned array. This causes the tenth element to consist of the two characters at the end of the input string.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#12</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Splits an input string a specified maximum number of times into an array of substrings, at the positions defined by a regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An array of strings.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to be split. </param>
|
||
<param name="count">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of times the split can occur. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Split">
|
||
<MemberSignature Language="C#" Value="public static string[] Split (string input, string pattern);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string[] Split(string input, string pattern) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are similar to the <see cref="M:System.String.Split(System.Char[])" /> method, except that <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> splits the string at a delimiter determined by a regular expression instead of a set of characters. The <paramref name="input" /> string is split as many times as possible. If <paramref name="pattern" /> is not found in the <paramref name="input" /> string, the return value contains one element whose value is the original <paramref name="input" /> string. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<block subset="none" type="note">
|
||
<para>Compiled regular expressions used in calls to static <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are automatically cached. To manage the lifetime of compiled regular expressions yourself, use the instance <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods.</para>
|
||
</block>
|
||
<para>If multiple matches are adjacent to one another, an empty string is inserted into the array. For example, splitting a string on a single hyphen causes the returned array to include an empty string in the position where two adjacent hyphens are found, as the following code shows.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#8</para>
|
||
<para>If a match is found at the beginning or the end of the input string, an empty string is included at the beginning or the end of the returned array. The following example uses the regular expression pattern \d+ to split an input string on numeric characters. Because the string begins and ends with matching numeric characters, the value of the first and last element of the returned array is <see cref="F:System.String.Empty" />.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#22</para>
|
||
<para>If capturing parentheses are used in a <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> expression, any captured text is included in the resulting string array. For example, if you split the string "plum-pear" on a hyphen placed within capturing parentheses, the returned array includes a string element that contains the hyphen.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#9</para>
|
||
<para>However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, if a match is not found within the first set of capturing parentheses, captured text from additional capturing parentheses is not included in the returned array. Starting with the .NET Framework 2.0, all captured text is also added to the returned array. For example, the following code uses two sets of capturing parentheses to extract the elements of a date, including the date delimiters, from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, it excludes the slash characters; if it is compiled and run under the .NET Framework 2.0 or later versions, it includes them.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#10</para>
|
||
<para>If the regular expression can match the empty string, <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> will split the string into an array of single-character strings because the empty string delimiter can be found at every location. For example:</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#13</para>
|
||
<para>Note that the returned array also includes an empty string at the beginning and end of the array.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the split operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Splits an input string into an array of substrings at the positions defined by a regular expression pattern.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An array of strings.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to split. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Split">
|
||
<MemberSignature Language="C#" Value="public string[] Split (string input, int count, int startat);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] Split(string input, int32 count, int32 startat) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="count" Type="System.Int32" />
|
||
<Parameter Name="startat" Type="System.Int32" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are similar to the <see cref="M:System.String.Split(System.Char[])" /> method, except that <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> splits the string at a delimiter determined by a regular expression instead of a set of characters. The <paramref name="count" /> parameter specifies the maximum number of substrings into which the <paramref name="input" /> string is split; the last string contains the unsplit remainder of the string. A <paramref name="count" /> value of zero provides the default behavior of splitting as many times as possible. The <paramref name="startat" /> parameter defines the point at which the search for the first delimiter begins (this can be used for skipping leading white space).</para>
|
||
<para>If no matches are found from the <paramref name="count" />+1 position in the string, the method returns a one-element array that contains the <paramref name="input" /> string. If one or more matches are found, the first element of the returned array contains the first portion of the string from the first character up to one character before the match.</para>
|
||
<para>If multiple matches are adjacent to one another and the number of matches found is at least two less than <paramref name="count" />, an empty string is inserted into the array. Similarly, if a match is found at <paramref name="startat" />, which is the first character in the string, the first element of the returned array is an empty string. That is, empty strings that result from adjacent matches are counted in determining whether the number of matched substrings equals <paramref name="count" />. In the following example, the regular expression \d+ is used to find the starting position of the first substring of numeric characters in a string, and then to split the string a maximum of three times starting at that position. Because the regular expression pattern matches the beginning of the input string, the returned string array consists of an empty string, a five-character alphabetic string, and the remainder of the string, </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#26</para>
|
||
<para>If capturing parentheses are used in a regular expression, any captured text is included in the array of split strings. However, any array elements that contain captured text are not counted in determining whether the number of matches has reached <paramref name="count" />. For example, splitting the string '"apple-apricot-plum-pear-pomegranate-pineapple-peach" into a maximum of four substrings beginning at character 15 in the string results in a seven-element array, as the following code shows. </para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#6</para>
|
||
<para>However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In .NET Framework 1.0 and 1.1, if a match is not found within the first set of capturing parentheses, captured text from additional capturing parentheses is not included in the returned array. Starting with the .NET Framework 2.0, all captured text is also added to the returned array. For example, the following code uses two sets of capturing parentheses to extract the individual words in a string. The first set of capturing parentheses captures the hyphen, and the second set captures the vertical bar. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, it excludes the vertical bar characters; if it is compiled and run under the .NET Framework 2.0 or later versions, it includes them.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#7</para>
|
||
<para>If the regular expression can match the empty string, <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> will split the string into an array of single-character strings because the empty string delimiter can be found at every location. The following example splits the string "characters" into as many elements as the input string contains, starting with the character "a". Because the null string matches the end of the input string, a null string is inserted at the end of the returned array.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#14</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the <see cref="M:System.Text.RegularExpressions.Regex.#ctor(System.String,System.Text.RegularExpressions.RegexOptions,System.TimeSpan)" /> constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the <see cref="T:System.Text.RegularExpressions.Regex" /> object is created. If no time-out is defined in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor call or in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Splits an input string a specified maximum number of times into an array of substrings, at the positions defined by a regular expression specified in the <see cref="T:System.Text.RegularExpressions.Regex" /> constructor. The search for the regular expression pattern starts at a specified character position in the input string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An array of strings.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to be split. </param>
|
||
<param name="count">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The maximum number of times the split can occur. </param>
|
||
<param name="startat">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The character position in the input string where the search will begin. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Split">
|
||
<MemberSignature Language="C#" Value="public static string[] Split (string input, string pattern, System.Text.RegularExpressions.RegexOptions options);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string[] Split(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are similar to the <see cref="M:System.String.Split(System.Char[])" /> method, except that <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original <paramref name="input" /> string. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<block subset="none" type="note">
|
||
<para>Compiled regular expressions used in calls to static <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are automatically cached. To manage the lifetime of compiled regular expressions yourself, use the instance <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods.</para>
|
||
</block>
|
||
<para>If multiple matches are adjacent to one another, an empty string is inserted into the array. For example, splitting a string on a single hyphen causes the returned array to include an empty string in the position where two adjacent hyphens are found.</para>
|
||
<para>If a match is found at the beginning or the end of the input string, an empty string is included at the beginning or the end of the returned array. The following example uses the regular expression pattern [a-z]+ to split an input string on any uppercase or lowercase alphabetic character. Because the string begins and ends with matching alphabetic characters, the value of the first and last element of the returned array is <see cref="F:System.String.Empty" />.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#24</para>
|
||
<para>If capturing parentheses are used in a <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> expression, any captured text is included in the resulting string array. For example, if you split the string "plum-pear" on a hyphen placed within capturing parentheses, the returned array includes a string element that contains the hyphen.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#9</para>
|
||
<para>However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, if a match is not found within the first set of capturing parentheses, captured text from additional capturing parentheses is not included in the returned array. Starting with the .NET Framework 2.0, all captured text is also added to the returned array. For example, the following code uses two sets of capturing parentheses to extract the elements of a date, including the date delimiters, from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, it excludes the slash characters; if it is compiled and run under the .NET Framework 2.0 or later versions, it includes them.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#10</para>
|
||
<para>If the regular expression can match the empty string, <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> will split the string into an array of single-character strings because the empty string delimiter can be found at every location.</para>
|
||
<para>The <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception is thrown if the execution time of the split operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" />, no exception is thrown. </para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Splits an input string into an array of substrings at the positions defined by a specified regular expression pattern. Specified options modify the matching operation.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>An array of strings.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to split. </param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match. </param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Split">
|
||
<MemberSignature Language="C#" Value="public static string[] Split (string input, string pattern, System.Text.RegularExpressions.RegexOptions options, TimeSpan matchTimeout);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string[] Split(string input, string pattern, valuetype System.Text.RegularExpressions.RegexOptions options, valuetype System.TimeSpan matchTimeout) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<Attributes>
|
||
<Attribute>
|
||
<AttributeName>System.MonoTODO("Timeouts are ignored.")</AttributeName>
|
||
</Attribute>
|
||
</Attributes>
|
||
<ReturnValue>
|
||
<ReturnType>System.String[]</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="input" Type="System.String" />
|
||
<Parameter Name="pattern" Type="System.String" />
|
||
<Parameter Name="options" Type="System.Text.RegularExpressions.RegexOptions" />
|
||
<Parameter Name="matchTimeout" Type="System.TimeSpan" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are similar to the <see cref="M:System.String.Split(System.Char[])" /> method, except that <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original <paramref name="input" /> string. </para>
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
<block subset="none" type="note">
|
||
<para>Compiled regular expressions used in calls to static <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods are automatically cached. To manage the lifetime of compiled regular expressions yourself, use the instance <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> methods.</para>
|
||
</block>
|
||
<para>If multiple matches are adjacent to one another, an empty string is inserted into the array. For example, splitting a string on a single hyphen causes the returned array to include an empty string in the position where two adjacent hyphens are found.</para>
|
||
<para>If a match is found at the beginning or the end of the input string, an empty string is included at the beginning or the end of the returned array. The following example uses the regular expression pattern [a-z]+ to split an input string on any uppercase or lowercase alphabetic character. Because the string begins and ends with matching alphabetic characters, the value of the first and last element of the returned array is <see cref="F:System.String.Empty" />.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#23</para>
|
||
<para>If capturing parentheses are used in a <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> expression, any captured text is included in the resulting string array. For example, if you split the string "plum-pear" on a hyphen placed within capturing parentheses, the returned array includes a string element that contains the hyphen.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#9</para>
|
||
<para>However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, if a match is not found within the first set of capturing parentheses, captured text from additional capturing parentheses is not included in the returned array. Starting with the .NET Framework 2.0, all captured text is also added to the returned array. For example, the following code uses two sets of capturing parentheses to extract the elements of a date, including the date delimiters, from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, it excludes the slash characters; if it is compiled and run under the .NET Framework 2.0 or later versions, it includes them.</para>
|
||
<para>code reference: System.Text.RegularExpressions.Regex.Split#10</para>
|
||
<para>If the regular expression can match the empty string, <see cref="M:System.Text.RegularExpressions.Regex.Split(System.String)" /> will split the string into an array of single-character strings because the empty string delimiter can be found at every location.</para>
|
||
<para>The <paramref name="matchTimeout" /> parameter specifies how long a pattern matching method should try to find a match before it times out. Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to stop responding when they process input that contains near matches. For more information, see <format type="text/html"><a href="618e5afb-3a97-440d-831a-70e4c526a51c">Best Practices for Regular Expressions in the .NET Framework</a></format> and <format type="text/html"><a href="34df1152-0b22-4a1c-a76c-3c28c47b70d8">Backtracking</a></format>. If no match is found in that time interval, the method throws a <see cref="T:System.Text.RegularExpressions.RegexMatchTimeoutException" /> exception. <paramref name="matchTimeout" /> overrides any default time-out value defined for the application domain in which the method executes.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Splits an input string into an array of substrings at the positions defined by a specified regular expression pattern. Additional parameters specify options that modify the matching operation and a time-out interval if no match is found.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A string array.</para>
|
||
</returns>
|
||
<param name="input">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The string to split.</param>
|
||
<param name="pattern">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The regular expression pattern to match.</param>
|
||
<param name="options">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A bitwise combination of the enumeration values that provide options for matching.</param>
|
||
<param name="matchTimeout">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />A time-out interval, or <see cref="F:System.Text.RegularExpressions.Regex.InfiniteMatchTimeout" /> to indicate that the method should not time out.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="System.Runtime.Serialization.ISerializable.GetObjectData">
|
||
<MemberSignature Language="C#" Value="void ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
|
||
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.ISerializable.GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Void</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" />
|
||
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
|
||
</Parameters>
|
||
<Docs>
|
||
<param name="info">To be added.</param>
|
||
<remarks>To be added.</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object with the data necessary to deserialize the current <see cref="T:System.Text.RegularExpressions.Regex" /> object.</para>
|
||
</summary>
|
||
<param name="context">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The place to store and retrieve serialized data. This parameter is reserved for future use.</param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="ToString">
|
||
<MemberSignature Language="C#" Value="public override string ToString ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <paramref name="pattern" /> parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see <format type="text/html"><a href="521b3f6d-f869-42e1-93e5-158c54a6895d">.NET Framework Regular Expressions</a></format> and <format type="text/html"><a href="930653a6-95d2-4697-9d5a-52d11bb6fd4c">Regular Expression Language Elements</a></format>.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Returns the regular expression pattern that was passed into the Regex constructor.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <paramref name="pattern" /> parameter that was passed into the Regex constructor.</para>
|
||
</returns>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="Unescape">
|
||
<MemberSignature Language="C#" Value="public static string Unescape (string str);" />
|
||
<MemberSignature Language="ILAsm" Value=".method public static hidebysig string Unescape(string str) cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.String</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters>
|
||
<Parameter Name="str" Type="System.String" />
|
||
</Parameters>
|
||
<Docs>
|
||
<remarks>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>The <see cref="M:System.Text.RegularExpressions.Regex.Unescape(System.String)" /> method performs one of the following two transformations: </para>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>It reverses the transformation performed by the <see cref="M:System.Text.RegularExpressions.Regex.Escape(System.String)" /> method by removing the escape character ("\") from each character escaped by the method. These include the \, *, +, ?, |, {, [, (,), ^, $,., #, and white space characters. In addition, the <see cref="M:System.Text.RegularExpressions.Regex.Unescape(System.String)" /> method unescapes the closing bracket (]) and closing brace (}) characters.</para>
|
||
</item>
|
||
</list>
|
||
<block subset="none" type="note">
|
||
<para>
|
||
<see cref="M:System.Text.RegularExpressions.Regex.Unescape(System.String)" /> cannot reverse an escaped string perfectly because it cannot deduce precisely which characters were escaped,</para>
|
||
</block>
|
||
<list type="bullet">
|
||
<item>
|
||
<para>It replaces the representation of unprintable characters with the characters themselves. For example, it replaces \a with \x07. The character representations it replaces are \a, \b, \e, \n, \r, \f, \t, and \v.</para>
|
||
</item>
|
||
</list>
|
||
<para>If the <see cref="M:System.Text.RegularExpressions.Regex.Unescape(System.String)" /> method encounters other escape sequences that it cannot convert, such as \w or \s, it throws an <see cref="T:System.ArgumentException" />.</para>
|
||
</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Converts any escaped characters in the input string.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>A string of characters with any escaped characters converted to their unescaped form.</para>
|
||
</returns>
|
||
<param name="str">
|
||
<attribution license="cc4" from="Microsoft" modified="false" />The input string containing the text to convert. </param>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="UseOptionC">
|
||
<MemberSignature Language="C#" Value="protected bool UseOptionC ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance bool UseOptionC() cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>To be added</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the <see cref="P:System.Text.RegularExpressions.Regex.Options" /> property contains the <see cref="F:System.Text.RegularExpressions.RegexOptions.Compiled" /> option; otherwise, false.</para>
|
||
</returns>
|
||
</Docs>
|
||
</Member>
|
||
<Member MemberName="UseOptionR">
|
||
<MemberSignature Language="C#" Value="protected bool UseOptionR ();" />
|
||
<MemberSignature Language="ILAsm" Value=".method familyhidebysig instance bool UseOptionR() cil managed" />
|
||
<MemberType>Method</MemberType>
|
||
<AssemblyInfo>
|
||
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
|
||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||
<AssemblyVersion>4.0.0.0</AssemblyVersion>
|
||
</AssemblyInfo>
|
||
<ReturnValue>
|
||
<ReturnType>System.Boolean</ReturnType>
|
||
</ReturnValue>
|
||
<Parameters />
|
||
<Docs>
|
||
<remarks>To be added</remarks>
|
||
<summary>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>Used by a <see cref="T:System.Text.RegularExpressions.Regex" /> object generated by the <see cref="Overload:System.Text.RegularExpressions.Regex.CompileToAssembly" /> method.</para>
|
||
</summary>
|
||
<returns>
|
||
<attribution license="cc4" from="Microsoft" modified="false" />
|
||
<para>true if the <see cref="P:System.Text.RegularExpressions.Regex.Options" /> property contains the <see cref="F:System.Text.RegularExpressions.RegexOptions.RightToLeft" /> option; otherwise, false.</para>
|
||
</returns>
|
||
</Docs>
|
||
</Member>
|
||
</Members>
|
||
</Type> |