@@ -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]";.
/// 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]";.
/// 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]";.
/// 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.
@@ -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< name >
///
///or:
///
///\k< number >
///
///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]";.
/// 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 {
/// 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]";.
/// 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 {
<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>
<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
<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>
<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>
<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>
<value>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<
<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>
<targetstate="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-unitid="regex_alternation_short">
<source>alternation</source>
<targetstate="new">alternation</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<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>
<targetstate="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>
<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>
<targetstate="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>
<targetstate="new">conditional group match</target>
<note/>
</trans-unit>
<trans-unitid="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>
<targetstate="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
<targetstate="new">escape character</target>
<note/>
</trans-unit>
<trans-unitid="regex_expression">
<source>expression</source>
<targetstate="new">expression</target>
<note/>
</trans-unit>
<trans-unitid="regex_form_feed_character_long">
<source>Matches a form-feed character, \u000C</source>
<targetstate="new">Matches a form-feed character, \u000C</target>
...
...
@@ -1240,6 +1327,49 @@ You can access captured groups in four ways:
<targetstate="new">name2</target>
<note/>
</trans-unit>
<trans-unitid="regex_name_or_number">
<source>name-or-number</source>
<targetstate="new">name-or-number</target>
<note/>
</trans-unit>
<trans-unitid="regex_named_backreference_long">
<source>A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<targetstate="new">A named backreference is defined by using the following syntax:
\k< name >
or:
\k< number >
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<name> 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>
<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<name> 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>
<targetstate="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<name> 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>
<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]<