提交 3422ae05 编写于 作者: C Cyrus Najmabadi

More consturctions.

上级 955e8b86
......@@ -136,6 +136,7 @@ private bool DetermineIfInCharacterClass(RegexTree tree, int pos)
{
AddIfMissing(context, CreateItem(stringToken, "#", regex_end_of_line_comment_short, regex_end_of_line_comment_long, context, parentOpt: null));
AddIfMissing(context, CreateItem(stringToken, "|", regex_alternation_short, regex_alternation_long, context, parentOpt: null));
AddIfMissing(context, CreateItem(stringToken, "^", regex_start_of_string_or_line_short, regex_start_of_string_or_line_long, context, parentOpt: null));
AddIfMissing(context, CreateItem(stringToken, "$", regex_end_of_string_or_line_short, regex_end_of_string_or_line_long, context, parentOpt: null));
AddIfMissing(context, CreateItem(stringToken, ".", regex_any_character_group_short, regex_any_character_group_long, context, parentOpt: null));
......@@ -238,6 +239,9 @@ private bool DetermineIfInCharacterClass(RegexTree tree, int pos)
AddIfMissing(context, CreateItem(stringToken, "(?<! " + regex_subexpression + " )", regex_zero_width_negative_lookbehind_assertion_short, regex_zero_width_negative_lookbehind_assertion_long, context, parentOpt, positionOffset: "(?<!".Length, insertionText: "(?<!)"));
AddIfMissing(context, CreateItem(stringToken, "(?> " + regex_subexpression + " )", regex_nonbacktracking_subexpression_short, regex_nonbacktracking_subexpression_long, context, parentOpt, positionOffset: "(?>".Length, insertionText: "(?>)"));
AddIfMissing(context, CreateItem(stringToken, "(?# " + regex_comment + " )", regex_inline_comment_short, regex_inline_comment_long, context, parentOpt, positionOffset: "(?#".Length, insertionText: "(?#)"));
AddIfMissing(context, CreateItem(stringToken, "(?( " + regex_expression + " ) " + regex_yes + " | " + regex_no + " )", regex_conditional_expression_match_short, regex_conditional_expression_match_long, context, parentOpt, positionOffset: "(?(".Length, insertionText: "(?()|)"));
AddIfMissing(context, CreateItem(stringToken, "(?( " + regex_name_or_number + " ) " + regex_yes + " | " + regex_no + " )", regex_conditional_group_match_short, regex_conditional_group_match_long, context, parentOpt, positionOffset: "(?(".Length, insertionText: "(?()|)"));
}
private void ProvideCharacterClassCompletions(
......@@ -282,9 +286,9 @@ private void ProvideEscapeCategoryCompletions(EmbeddedCompletionContext context)
AddIfMissing(context, CreateItem(stringToken, @"\z", regex_end_of_string_only_short, regex_end_of_string_only_long, context, parentOpt));
AddIfMissing(context, CreateItem(stringToken, @"\Z", regex_end_of_string_or_before_ending_newline_short, regex_end_of_string_or_before_ending_newline_long, context, parentOpt));
AddIfMissing(context, CreateItem(stringToken, @"\k<>", "", "", context, parentOpt, @"\k<".Length));
AddIfMissing(context, CreateItem(stringToken, @"\<>", "", "", context, parentOpt, @"\<".Length));
AddIfMissing(context, CreateItem(stringToken, @"\1-9", "", "", context, parentOpt, @"\".Length, @"\"));
AddIfMissing(context, CreateItem(stringToken, @"\k< " + regex_name_or_number + " >", regex_named_backreference_short, regex_named_backreference_long, context, parentOpt, @"\k<".Length, insertionText: @"\k<>"));
// AddIfMissing(context, CreateItem(stringToken, @"\<>", "", "", context, parentOpt, @"\<".Length));
AddIfMissing(context, CreateItem(stringToken, @"\1-9", regex_numbered_backreference_short, regex_numbered_backreference_long, context, parentOpt, @"\".Length, @"\"));
}
AddIfMissing(context, CreateItem(stringToken, @"\a", regex_bell_character_short, regex_bell_character_long, context, parentOpt));
......
......@@ -1241,6 +1241,28 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
///
///Like the positive character class, the | character can be used to match any one of a number of single characters.
///
///The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality [rest of string was truncated]&quot;;.
/// </summary>
internal static string regex_alternation_long {
get {
return ResourceManager.GetString("regex_alternation_long", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to alternation.
/// </summary>
internal static string regex_alternation_short {
get {
return ResourceManager.GetString("regex_alternation_short", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character..
/// </summary>
......@@ -1344,6 +1366,56 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
///
///(?( expression ) yes | no )
///
///where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expre [rest of string was truncated]&quot;;.
/// </summary>
internal static string regex_conditional_expression_match_long {
get {
return ResourceManager.GetString("regex_conditional_expression_match_long", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to conditional expression match.
/// </summary>
internal static string regex_conditional_expression_match_short {
get {
return ResourceManager.GetString("regex_conditional_expression_match_short", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
///
///(?( name ) yes | no )
///
///or
///
///(?( number ) yes | no )
///
///where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
///
///If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alte [rest of string was truncated]&quot;;.
/// </summary>
internal static string regex_conditional_group_match_long {
get {
return ResourceManager.GetString("regex_conditional_group_match_long", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to conditional group match.
/// </summary>
internal static string regex_conditional_group_match_short {
get {
return ResourceManager.GetString("regex_conditional_group_match_short", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous..
/// </summary>
......@@ -1494,6 +1566,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to expression.
/// </summary>
internal static string regex_expression {
get {
return ResourceManager.GetString("regex_expression", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Matches a form-feed character, \u000C.
/// </summary>
......@@ -1627,6 +1708,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to name-or-number.
/// </summary>
internal static string regex_name_or_number {
get {
return ResourceManager.GetString("regex_name_or_number", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to name1.
/// </summary>
......@@ -1645,6 +1735,36 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to A named backreference is defined by using the following syntax:
///
///\k&lt; name &gt;
///
///or:
///
///\k&lt; number &gt;
///
///where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
///
///In a named backreference with \k, name can also be the string representation of a number.
///
///If name is the string representation of a number, and no capturing group has th [rest of string was truncated]&quot;;.
/// </summary>
internal static string regex_named_backreference_long {
get {
return ResourceManager.GetString("regex_named_backreference_long", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to named backreference.
/// </summary>
internal static string regex_named_backreference_short {
get {
return ResourceManager.GetString("regex_named_backreference_short", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The following grouping construct captures a matched subexpression and lets you access it by name or by number:
///
......@@ -1731,6 +1851,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to no.
/// </summary>
internal static string regex_no {
get {
return ResourceManager.GetString("regex_no", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to \D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
///
......@@ -1870,6 +1999,28 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to A numbered backreference uses the following syntax:
///
///\ number
///
///where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name [rest of string was truncated]&quot;;.
/// </summary>
internal static string regex_numbered_backreference_long {
get {
return ResourceManager.GetString("regex_numbered_backreference_long", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to numbered backreference.
/// </summary>
internal static string regex_numbered_backreference_short {
get {
return ResourceManager.GetString("regex_numbered_backreference_short", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
///
......@@ -2088,6 +2239,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to yes.
/// </summary>
internal static string regex_yes {
get {
return ResourceManager.GetString("regex_yes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to The following grouping construct defines a zero-width negative lookahead assertion:
///
......
......@@ -1014,6 +1014,16 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<data name="regex_word_character_short" xml:space="preserve">
<value>word character</value>
</data>
<data name="regex_alternation_long" xml:space="preserve">
<value>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</value>
</data>
<data name="regex_alternation_short" xml:space="preserve">
<value>alternation</value>
</data>
<data name="regex_balancing_group_long" xml:space="preserve">
<value>A balancing group definition deletes the definition of a previously defined group and stores, in the current group, the interval between the previously defined group and the current group. This grouping construct has the following format:
......@@ -1033,12 +1043,49 @@ After you modify the regular expression in the following example to use the appr
<data name="regex_comment" xml:space="preserve">
<value>comment</value>
</data>
<data name="regex_conditional_expression_match_long" xml:space="preserve">
<value>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</value>
</data>
<data name="regex_conditional_expression_match_short" xml:space="preserve">
<value>conditional expression match</value>
</data>
<data name="regex_conditional_group_match_long" xml:space="preserve">
<value>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</value>
</data>
<data name="regex_conditional_group_match_short" xml:space="preserve">
<value>conditional group match</value>
</data>
<data name="regex_end_of_line_comment_long" xml:space="preserve">
<value>A number sign (#) marks an x-mode comment, which starts at the unescaped # character at the end of the regular expression pattern and continues until the end of the line. To use this construct, you must either enable the x option (through inline options) or supply the RegexOptions.IgnorePatternWhitespace value to the option parameter when instantiating the Regex object or calling a static Regex method.</value>
</data>
<data name="regex_end_of_line_comment_short" xml:space="preserve">
<value>end-of-line comment</value>
</data>
<data name="regex_expression" xml:space="preserve">
<value>expression</value>
</data>
<data name="regex_group_options_long" xml:space="preserve">
<value>The following grouping construct applies or disables the specified options within a subexpression:
......@@ -1070,6 +1117,26 @@ The group options construct is not a capturing group. That is, although any port
<data name="regex_name2" xml:space="preserve">
<value>name2</value>
</data>
<data name="regex_named_backreference_long" xml:space="preserve">
<value>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</value>
</data>
<data name="regex_named_backreference_short" xml:space="preserve">
<value>named backreference</value>
</data>
<data name="regex_named_matched_subexpression_long" xml:space="preserve">
<value>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1098,6 +1165,12 @@ You can access named captured groups in the following ways:
<data name="regex_named_matched_subexpression_short" xml:space="preserve">
<value>named matched subexpression</value>
</data>
<data name="regex_name_or_number" xml:space="preserve">
<value>name-or-number</value>
</data>
<data name="regex_no" xml:space="preserve">
<value>no</value>
</data>
<data name="regex_nonbacktracking_subexpression_long" xml:space="preserve">
<value>The following grouping construct represents a nonbacktracking subexpression (also known as a "greedy" subexpression):
......@@ -1128,6 +1201,31 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<data name="regex_noncapturing_group_short" xml:space="preserve">
<value>noncapturing group</value>
</data>
<data name="regex_numbered_backreference_long" xml:space="preserve">
<value>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</value>
</data>
<data name="regex_numbered_backreference_short" xml:space="preserve">
<value>numbered backreference</value>
</data>
<data name="regex_yes" xml:space="preserve">
<value>yes</value>
</data>
<data name="regex_zero_width_negative_lookahead_assertion_long" xml:space="preserve">
<value>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
......@@ -947,6 +947,24 @@
<target state="new">Unterminated (?#...) comment</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_long">
<source>You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</source>
<target state="new">You can use the vertical bar (|) character to match any one of a series of patterns, where the | character separates each pattern.
Like the positive character class, the | character can be used to match any one of a number of single characters.
The | character can also be used to perform an either/or match with multiple characters or subexpressions, which can include any combination of character literals and regular expression language elements. (The character class does not provide this functionality.)</target>
<note />
</trans-unit>
<trans-unit id="regex_alternation_short">
<source>alternation</source>
<target state="new">alternation</target>
<note />
</trans-unit>
<trans-unit id="regex_any_character_group_long">
<source>The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</source>
<target state="new">The period character (.) matches any character except \n (the newline character, \u000A). If a regular expression pattern is modified by the RegexOptions.Singleline option, or if the portion of the pattern that contains the . character class is modified by the s option, . matches any character.</target>
......@@ -1022,6 +1040,70 @@ After you modify the regular expression in the following example to use the appr
<target state="new">comment</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_long">
<source>This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it can match an initial pattern. Its syntax is:
(?( expression ) yes | no )
where expression is the initial pattern to match, yes is the pattern to match if expression is matched, and no is the optional pattern to match if expression is not matched. The regular expression engine treats expression as a zero-width assertion; that is, the regular expression engine does not advance in the input stream after it evaluates expression. Therefore, this construct is equivalent to the following:
(?(?= expression ) yes | no )
where (?=expression) is a zero-width assertion construct. Because the regular expression engine interprets expression as an anchor (a zero-width assertion), expression must either be a zero-width assertion (for more information, see Anchors) or a subexpression that is also contained in yes. Otherwise, the yes pattern cannot be matched.
Note
If 'expression' is a named or numbered capturing group, the alternation construct is interpreted as a capture test. In other words, the regular expression engine does not attempt to match the captured substring, but instead tests for the presence or absence of the group.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_expression_match_short">
<source>conditional expression match</source>
<target state="new">conditional expression match</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_long">
<source>This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</source>
<target state="new">This language element attempts to match one of two patterns depending on whether it has matched a specified capturing group. Its syntax is:
(?( name ) yes | no )
or
(?( number ) yes | no )
where name is the name and number is the number of a capturing group, yes is the expression to match if name or number has a match, and no is the optional expression to match if it does not.
If name does not correspond to the name of a capturing group that is used in the regular expression pattern, the alternation construct is interpreted as an expression test, as explained in the previous section. Typically, this means that expression evaluates to false. If number does not correspond to a numbered capturing group that is used in the regular expression pattern, the regular expression engine throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_conditional_group_match_short">
<source>conditional group match</source>
<target state="new">conditional group match</target>
<note />
</trans-unit>
<trans-unit id="regex_contiguous_matches_long">
<source>The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</source>
<target state="new">The \G anchor specifies that a match must occur at the point where the previous match ended. When you use this anchor with the Regex.Matches or Match.NextMatch method, it ensures that all matches are contiguous.</target>
......@@ -1114,6 +1196,11 @@ If you use $ with the RegexOptions.Multiline option, the match can also occur at
<target state="new">escape character</target>
<note />
</trans-unit>
<trans-unit id="regex_expression">
<source>expression</source>
<target state="new">expression</target>
<note />
</trans-unit>
<trans-unit id="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<target state="new">Matches a form-feed character, \u000C</target>
......@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<target state="new">name2</target>
<note />
</trans-unit>
<trans-unit id="regex_name_or_number">
<source>name-or-number</source>
<target state="new">name-or-number</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</source>
<target state="new">A named backreference is defined by using the following syntax:
\k&lt; name &gt;
or:
\k&lt; number &gt;
where name is the name of a capturing group defined in the regular expression pattern. If name is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException.
In a named backreference with \k, name can also be the string representation of a number.
If name is the string representation of a number, and no capturing group has that name, \k&lt;name&gt; is the same as the backreference \number, where number is the ordinal position of the capture.
However, if name is the string representation of a number and the capturing group in that position has been explicitly assigned a numeric name, the regular expression parser cannot identify the capturing group by its ordinal position. Instead, it throws an ArgumentException.</target>
<note />
</trans-unit>
<trans-unit id="regex_named_backreference_short">
<source>named backreference</source>
<target state="new">named backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_named_matched_subexpression_long">
<source>The following grouping construct captures a matched subexpression and lets you access it by name or by number:
......@@ -1376,6 +1506,11 @@ matches any character that does not belong to a Unicode general category or name
<target state="new">new-line character</target>
<note />
</trans-unit>
<trans-unit id="regex_no">
<source>no</source>
<target state="new">no</target>
<note />
</trans-unit>
<trans-unit id="regex_non_digit_character_long">
<source>\D matches any non-digit character. It is equivalent to the \P{Nd} regular expression pattern.
......@@ -1510,6 +1645,48 @@ If a regular expression includes nested grouping constructs, an outer noncapturi
<target state="new">noncapturing group</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_long">
<source>A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</source>
<target state="new">A numbered backreference uses the following syntax:
\ number
where number is the ordinal position of the capturing group in the regular expression. For example, \4 matches the contents of the fourth capturing group. If number is not defined in the regular expression pattern, a parsing error occurs, and the regular expression engine throws an ArgumentException. In addition, if number identifies a capturing group in a particular ordinal position, but that capturing group has been assigned a numeric name different than its ordinal position, the regular expression parser also throws an ArgumentException.
Note the ambiguity between octal escape codes (such as \16) and \number backreferences that use the same notation. This ambiguity is resolved as follows:
The expressions \1 through \9 are always interpreted as backreferences, and not as octal codes.
If the first digit of a multidigit expression is 8 or 9 (such as \80 or \91), the expression as interpreted as a literal.
Expressions from \10 and greater are considered backreferences if there is a backreference corresponding to that number; otherwise, they are interpreted as octal codes.
If a regular expression contains a backreference to an undefined group number, a parsing error occurs, and the regular expression engine throws an ArgumentException.
If the ambiguity is a problem, you can use the \k&lt;name&gt; notation, which is unambiguous and cannot be confused with octal character codes. Similarly, hexadecimal codes such as \xdd are unambiguous and cannot be confused with backreferences.</target>
<note />
</trans-unit>
<trans-unit id="regex_numbered_backreference_short">
<source>numbered backreference</source>
<target state="new">numbered backreference</target>
<note />
</trans-unit>
<trans-unit id="regex_positive_character_group_long">
<source>A positive character group specifies a list of characters, any one of which may appear in an input string for a match to occur. This list of characters may be specified individually, as a range, or both.
......@@ -1697,6 +1874,11 @@ If ECMAScript-compliant behavior is specified, \w is equivalent to [a-zA-Z_0-9]<
<target state="new">word character</target>
<note />
</trans-unit>
<trans-unit id="regex_yes">
<source>yes</source>
<target state="new">yes</target>
<note />
</trans-unit>
<trans-unit id="regex_zero_width_negative_lookahead_assertion_long">
<source>The following grouping construct defines a zero-width negative lookahead assertion:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册