diff --git a/docs/core/additional-tools/uninstall-tool-overview.md b/docs/core/additional-tools/uninstall-tool-overview.md index 95a61a804b481..e864701ca729e 100644 --- a/docs/core/additional-tools/uninstall-tool-overview.md +++ b/docs/core/additional-tools/uninstall-tool-overview.md @@ -3,7 +3,7 @@ title: .NET Uninstall Tool overview description: An overview of .NET Uninstall Tool. This tool is a guided command-line tool that removes .NET SDKs and runtimes. author: adegeo ms.custom: devdivchpfy22 -ms.date: 08/04/2024 +ms.date: 03/20/2026 zone_pivot_groups: operating-systems-set-three --- @@ -58,12 +58,12 @@ winget install --id Microsoft.DotNet.UninstallTool --source winget ::: zone pivot="os-macos" -01. Download the _dotnet-core-uninstall.tar.gz_ tarball from the [the GitHub releases page](https://aka.ms/dotnet-core-uninstall-tool). -01. Run the following shell script to extract the tarball to a directory named _dotnet-core-uninstall_ in your home directory: +01. Download the _dotnet-core-uninstall-\*.tar.gz_ tarball from the [the GitHub releases page](https://aka.ms/dotnet-core-uninstall-tool). +01. Run the following shell script to extract the tarball to a directory named _dotnet-core-uninstall_ in your home directory. The following example extracts the Arm64 version of the tool: ```bash mkdir -p ~/dotnet-core-uninstall - tar -zxf dotnet-core-uninstall.tar.gz -C ~/dotnet-core-uninstall + tar -zxf dotnet-core-uninstall-osx-arm64.tar.gz -C ~/dotnet-core-uninstall ``` ::: zone-end @@ -96,7 +96,7 @@ To manually uninstall the tool, perform the following steps: ::: zone pivot="os-macos" -If you extracted the _dotnet-core-uninstall.tar.gz_ tarball, delete the extracted files. +If you extracted the _dotnet-core-uninstall-\*.tar.gz_ tarball, delete the extracted files. ::: zone-end diff --git a/docs/standard/base-types/alternation-constructs-in-regular-expressions.md b/docs/standard/base-types/alternation-constructs-in-regular-expressions.md index 3169c628713a1..84ef6a8419819 100644 --- a/docs/standard/base-types/alternation-constructs-in-regular-expressions.md +++ b/docs/standard/base-types/alternation-constructs-in-regular-expressions.md @@ -31,8 +31,8 @@ You can use the vertical bar (`|`) character to match any one of a series of pat Like the positive character class, the `|` character can be used to match any one of a number of single characters. The following example uses both a positive character class and either/or pattern matching with the `|` character to locate occurrences of the words "gray" or "grey" in a string. In this case, the `|` character produces a regular expression that is more verbose. -[!code-csharp[RegularExpressions.Language.Alternation#1](~/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation1.cs#1)] -[!code-vb[RegularExpressions.Language.Alternation#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation1.vb#1)] +:::code language="csharp" source="./snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs" id="EitherOrCharacterClass"::: +:::code language="vb" source="./snippets/alternation-constructs-in-regular-expressions/vb/Program.vb" id="EitherOrCharacterClass"::: The regular expression that uses the `|` character, `\bgr(a|e)y\b`, is interpreted as shown in the following table: @@ -45,8 +45,8 @@ The regular expression that uses the `|` character, `\bgr(a|e)y\b`, is interpret 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.) The following example uses the `|` character to extract either a U.S. Social Security Number (SSN), which is a 9-digit number with the format *ddd*-*dd*-*dddd*, or a U.S. Employer Identification Number (EIN), which is a 9-digit number with the format *dd*-*ddddddd*. -[!code-csharp[RegularExpressions.Language.Alternation#2](~/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation2.cs#2)] -[!code-vb[RegularExpressions.Language.Alternation#2](~/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation2.vb#2)] +:::code language="csharp" source="./snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs" id="EitherOrPatterns"::: +:::code language="vb" source="./snippets/alternation-constructs-in-regular-expressions/vb/Program.vb" id="EitherOrPatterns"::: The regular expression `\b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b` is interpreted as shown in the following table: @@ -79,8 +79,8 @@ where `(?=`*expression*`)` is a zero-width assertion construct. (For more inform The following example is a variation of the example that appears in the [Either/Or Pattern Matching with |](#Either_Or) section. It uses conditional matching to determine whether the first three characters after a word boundary are two digits followed by a hyphen. If they are, it attempts to match a U.S. Employer Identification Number (EIN). If not, it attempts to match a U.S. Social Security Number (SSN). -[!code-csharp[RegularExpressions.Language.Alternation#3](~/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation3.cs#3)] -[!code-vb[RegularExpressions.Language.Alternation#3](~/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation3.vb#3)] +:::code language="csharp" source="./snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs" id="ConditionalExpression"::: +:::code language="vb" source="./snippets/alternation-constructs-in-regular-expressions/vb/Program.vb" id="ConditionalExpression"::: The regular expression pattern `\b(?(\d{2}-)\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b` is interpreted as shown in the following table: @@ -118,8 +118,8 @@ If *name* does not correspond to the name of a capturing group that is used in t The following example is a variation of the example that appears in the [Either/Or Pattern Matching with |](#Either_Or) section. It uses a capturing group named `n2` that consists of two digits followed by a hyphen. The alternation construct tests whether this capturing group has been matched in the input string. If it has, the alternation construct attempts to match the last seven digits of a nine-digit U.S. Employer Identification Number (EIN). If it has not, it attempts to match a nine-digit U.S. Social Security Number (SSN). -[!code-csharp[RegularExpressions.Language.Alternation#4](~/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation4.cs#4)] -[!code-vb[RegularExpressions.Language.Alternation#4](~/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation4.vb#4)] +:::code language="csharp" source="./snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs" id="ConditionalNamedGroup"::: +:::code language="vb" source="./snippets/alternation-constructs-in-regular-expressions/vb/Program.vb" id="ConditionalNamedGroup"::: The regular expression pattern `\b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b` is interpreted as shown in the following table: @@ -134,8 +134,8 @@ The regular expression pattern `\b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b A variation of this example that uses a numbered group instead of a named group is shown in the following example. Its regular expression pattern is `\b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b`. -[!code-csharp[RegularExpressions.Language.Alternation#5](~/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation5.cs#5)] -[!code-vb[RegularExpressions.Language.Alternation#5](~/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation5.vb#5)] +:::code language="csharp" source="./snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs" id="ConditionalNumberedGroup"::: +:::code language="vb" source="./snippets/alternation-constructs-in-regular-expressions/vb/Program.vb" id="ConditionalNumberedGroup"::: ## See also diff --git a/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs new file mode 100644 index 0000000000000..284ea0e1646dd --- /dev/null +++ b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/csharp/Program.cs @@ -0,0 +1,53 @@ +using System.Text.RegularExpressions; + +// +string pattern1 = @"\bgr[ae]y\b"; +string pattern2 = @"\bgr(a|e)y\b"; + +string input = "The gray wolf blended in among the grey rocks."; +foreach (Match match in Regex.Matches(input, pattern1)) + Console.WriteLine($"'{match.Value}' found at position {match.Index}"); +Console.WriteLine(); +foreach (Match match in Regex.Matches(input, pattern2)) + Console.WriteLine($"'{match.Value}' found at position {match.Index}"); +// + +Console.WriteLine(); + +// +string eitherOrPattern = @"\b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b"; +string eitherOrInput = "01-9999999 020-333333 777-88-9999"; +Console.WriteLine($"Matches for {eitherOrPattern}:"); +foreach (Match match in Regex.Matches(eitherOrInput, eitherOrPattern)) + Console.WriteLine($" {match.Value} at position {match.Index}"); +// + +Console.WriteLine(); + +// +string condExprPattern = @"\b(?(\d{2}-)\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b"; +string condExprInput = "01-9999999 020-333333 777-88-9999"; +Console.WriteLine($"Matches for {condExprPattern}:"); +foreach (Match match in Regex.Matches(condExprInput, condExprPattern)) + Console.WriteLine($" {match.Value} at position {match.Index}"); +// + +Console.WriteLine(); + +// +string namedGroupPattern = @"\b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b"; +string namedGroupInput = "01-9999999 020-333333 777-88-9999"; +Console.WriteLine($"Matches for {namedGroupPattern}:"); +foreach (Match match in Regex.Matches(namedGroupInput, namedGroupPattern)) + Console.WriteLine($" {match.Value} at position {match.Index}"); +// + +Console.WriteLine(); + +// +string numberedGroupPattern = @"\b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b"; +string numberedGroupInput = "01-9999999 020-333333 777-88-9999"; +Console.WriteLine($"Matches for {numberedGroupPattern}:"); +foreach (Match match in Regex.Matches(numberedGroupInput, numberedGroupPattern)) + Console.WriteLine($" {match.Value} at position {match.Index}"); +// diff --git a/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/csharp/csharp.csproj b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/csharp/csharp.csproj new file mode 100644 index 0000000000000..ed9781c223ab9 --- /dev/null +++ b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/csharp/csharp.csproj @@ -0,0 +1,10 @@ + + + + Exe + net10.0 + enable + enable + + + diff --git a/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/vb/Program.vb b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/vb/Program.vb new file mode 100644 index 0000000000000..b34598d5ccdff --- /dev/null +++ b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/vb/Program.vb @@ -0,0 +1,63 @@ +Imports System.Text.RegularExpressions + +Module Program + Sub Main(args As String()) + ' + Dim pattern1 As String = "\bgr[ae]y\b" + Dim pattern2 As String = "\bgr(a|e)y\b" + + Dim input As String = "The gray wolf blended in among the grey rocks." + For Each match As Match In Regex.Matches(input, pattern1) + Console.WriteLine($"'{match.Value}' found at position {match.Index}") + Next + Console.WriteLine() + For Each match As Match In Regex.Matches(input, pattern2) + Console.WriteLine($"'{match.Value}' found at position {match.Index}") + Next + ' + + Console.WriteLine() + + ' + Dim eitherOrPattern As String = "\b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b" + Dim eitherOrInput As String = "01-9999999 020-333333 777-88-9999" + Console.WriteLine($"Matches for {eitherOrPattern}:") + For Each match As Match In Regex.Matches(eitherOrInput, eitherOrPattern) + Console.WriteLine($" {match.Value} at position {match.Index}") + Next + ' + + Console.WriteLine() + + ' + Dim condExprPattern As String = "\b(?(\d{2}-)\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b" + Dim condExprInput As String = "01-9999999 020-333333 777-88-9999" + Console.WriteLine($"Matches for {condExprPattern}:") + For Each match As Match In Regex.Matches(condExprInput, condExprPattern) + Console.WriteLine($" {match.Value} at position {match.Index}") + Next + ' + + Console.WriteLine() + + ' + Dim namedGroupPattern As String = "\b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b" + Dim namedGroupInput As String = "01-9999999 020-333333 777-88-9999" + Console.WriteLine($"Matches for {namedGroupPattern}:") + For Each match As Match In Regex.Matches(namedGroupInput, namedGroupPattern) + Console.WriteLine($" {match.Value} at position {match.Index}") + Next + ' + + Console.WriteLine() + + ' + Dim numberedGroupPattern As String = "\b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b" + Dim numberedGroupInput As String = "01-9999999 020-333333 777-88-9999" + Console.WriteLine($"Matches for {numberedGroupPattern}:") + For Each match As Match In Regex.Matches(numberedGroupInput, numberedGroupPattern) + Console.WriteLine($" {match.Value} at position {match.Index}") + Next + ' + End Sub +End Module diff --git a/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/vb/vb.vbproj b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/vb/vb.vbproj new file mode 100644 index 0000000000000..c54e4d3031486 --- /dev/null +++ b/docs/standard/base-types/snippets/alternation-constructs-in-regular-expressions/vb/vb.vbproj @@ -0,0 +1,9 @@ + + + + Exe + vb + net10.0 + + + diff --git a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation1.cs b/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation1.cs deleted file mode 100644 index 235d5bddf91b1..0000000000000 --- a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation1.cs +++ /dev/null @@ -1,28 +0,0 @@ -// -using System; -using System.Text.RegularExpressions; - -public class Example -{ - public static void Main() - { - // Regular expression using character class. - string pattern1 = @"\bgr[ae]y\b"; - // Regular expression using either/or. - string pattern2 = @"\bgr(a|e)y\b"; - - string input = "The gray wolf blended in among the grey rocks."; - foreach (Match match in Regex.Matches(input, pattern1)) - Console.WriteLine($"'{match.Value}' found at position {match.Index}"); - Console.WriteLine(); - foreach (Match match in Regex.Matches(input, pattern2)) - Console.WriteLine($"'{match.Value}' found at position {match.Index}"); - } -} -// The example displays the following output: -// 'gray' found at position 4 -// 'grey' found at position 35 -// -// 'gray' found at position 4 -// 'grey' found at position 35 -// diff --git a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation2.cs b/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation2.cs deleted file mode 100644 index ac43a7d3ef10b..0000000000000 --- a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation2.cs +++ /dev/null @@ -1,20 +0,0 @@ -// -using System; -using System.Text.RegularExpressions; - -public class Example -{ - public static void Main() - { - string pattern = @"\b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b"; - string input = "01-9999999 020-333333 777-88-9999"; - Console.WriteLine($"Matches for {pattern}:"); - foreach (Match match in Regex.Matches(input, pattern)) - Console.WriteLine($" {match.Value} at position {match.Index}"); - } -} -// The example displays the following output: -// Matches for \b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b: -// 01-9999999 at position 0 -// 777-88-9999 at position 22 -// diff --git a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation3.cs b/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation3.cs deleted file mode 100644 index 42b2d1fbf5fbc..0000000000000 --- a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation3.cs +++ /dev/null @@ -1,20 +0,0 @@ -// -using System; -using System.Text.RegularExpressions; - -public class Example -{ - public static void Main() - { - string pattern = @"\b(?(\d{2}-)\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b"; - string input = "01-9999999 020-333333 777-88-9999"; - Console.WriteLine($"Matches for {pattern}:"); - foreach (Match match in Regex.Matches(input, pattern)) - Console.WriteLine($" {match.Value} at position {match.Index}"); - } -} -// The example displays the following output: -// Matches for \b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b: -// 01-9999999 at position 0 -// 777-88-9999 at position 22 -// diff --git a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation4.cs b/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation4.cs deleted file mode 100644 index 21d94a242146c..0000000000000 --- a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation4.cs +++ /dev/null @@ -1,20 +0,0 @@ -// -using System; -using System.Text.RegularExpressions; - -public class Example -{ - public static void Main() - { - string pattern = @"\b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b"; - string input = "01-9999999 020-333333 777-88-9999"; - Console.WriteLine($"Matches for {pattern}:"); - foreach (Match match in Regex.Matches(input, pattern)) - Console.WriteLine($" {match.Value} at position {match.Index}"); - } -} -// The example displays the following output: -// Matches for \b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b: -// 01-9999999 at position 0 -// 777-88-9999 at position 22 -// diff --git a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation5.cs b/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation5.cs deleted file mode 100644 index 95aa224b776d0..0000000000000 --- a/samples/snippets/csharp/VS_Snippets_CLR/regularexpressions.language.alternation/cs/alternation5.cs +++ /dev/null @@ -1,20 +0,0 @@ -// -using System; -using System.Text.RegularExpressions; - -public class Example -{ - public static void Main() - { - string pattern = @"\b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b"; - string input = "01-9999999 020-333333 777-88-9999"; - Console.WriteLine($"Matches for {pattern}:"); - foreach (Match match in Regex.Matches(input, pattern)) - Console.WriteLine($" {match.Value} at position {match.Index}"); - } -} -// The example display the following output: -// Matches for \b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b: -// 01-9999999 at position 0 -// 777-88-9999 at position 22 -// diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation1.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation1.vb deleted file mode 100644 index ef4e6fbe5a1cf..0000000000000 --- a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation1.vb +++ /dev/null @@ -1,33 +0,0 @@ -' Visual Basic .NET Document -Option Strict On - -' -Imports System.Text.RegularExpressions - -Module Example - Public Sub Main() - ' Regular expression using character class. - Dim pattern1 As String = "\bgr[ae]y\b" - ' Regular expression using either/or. - Dim pattern2 As String = "\bgr(a|e)y\b" - - Dim input As String = "The gray wolf blended in among the grey rocks." - For Each match As Match In Regex.Matches(input, pattern1) - Console.WriteLine("'{0}' found at position {1}", _ - match.Value, match.Index) - Next - Console.WriteLine() - For Each match As Match In Regex.Matches(input, pattern2) - Console.WriteLine("'{0}' found at position {1}", _ - match.Value, match.Index) - Next - End Sub -End Module -' The example displays the following output: -' 'gray' found at position 4 -' 'grey' found at position 35 -' -' 'gray' found at position 4 -' 'grey' found at position 35 -' - diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation2.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation2.vb deleted file mode 100644 index 43ae84a4b5bd3..0000000000000 --- a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation2.vb +++ /dev/null @@ -1,21 +0,0 @@ -' Visual Basic .NET Document -Option Strict On - -' -Imports System.Text.RegularExpressions - -Module Example - Public Sub Main() - Dim pattern As String = "\b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b" - Dim input As String = "01-9999999 020-333333 777-88-9999" - Console.WriteLine("Matches for {0}:", pattern) - For Each match As Match In Regex.Matches(input, pattern) - Console.WriteLine(" {0} at position {1}", match.Value, match.Index) - Next - End Sub -End Module -' The example displays the following output: -' Matches for \b(\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b: -' 01-9999999 at position 0 -' 777-88-9999 at position 22 -' diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation3.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation3.vb deleted file mode 100644 index b9f8c8b47cab9..0000000000000 --- a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation3.vb +++ /dev/null @@ -1,21 +0,0 @@ -' Visual Basic .NET Document -Option Strict On - -' -Imports System.Text.RegularExpressions - -Module Example - Public Sub Main() - Dim pattern As String = "\b(?(\d{2}-)\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b" - Dim input As String = "01-9999999 020-333333 777-88-9999" - Console.WriteLine("Matches for {0}:", pattern) - For Each match As Match In Regex.Matches(input, pattern) - Console.WriteLine(" {0} at position {1}", match.Value, match.Index) - Next - End Sub -End Module -' The example displays the following output: -' Matches for \b(?(\d{2}-)\d{2}-\d{7}|\d{3}-\d{2}-\d{4})\b: -' 01-9999999 at position 0 -' 777-88-9999 at position 22 -' diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation4.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation4.vb deleted file mode 100644 index 8ffb7c5722e58..0000000000000 --- a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation4.vb +++ /dev/null @@ -1,17 +0,0 @@ -' Visual Basic .NET Document -Option Strict On - -' -Imports System.Text.RegularExpressions - -Module Example - Public Sub Main() - Dim pattern As String = "\b(?\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b" - Dim input As String = "01-9999999 020-333333 777-88-9999" - Console.WriteLine("Matches for {0}:", pattern) - For Each match As Match In Regex.Matches(input, pattern) - Console.WriteLine(" {0} at position {1}", match.Value, match.Index) - Next - End Sub -End Module -' diff --git a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation5.vb b/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation5.vb deleted file mode 100644 index bd3ad609b7199..0000000000000 --- a/samples/snippets/visualbasic/VS_Snippets_CLR/regularexpressions.language.alternation/vb/alternation5.vb +++ /dev/null @@ -1,21 +0,0 @@ -' Visual Basic .NET Document -Option Strict On - -' -Imports System.Text.RegularExpressions - -Module Example - Public Sub Main() - Dim pattern As String = "\b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b" - Dim input As String = "01-9999999 020-333333 777-88-9999" - Console.WriteLine("Matches for {0}:", pattern) - For Each match As Match In Regex.Matches(input, pattern) - Console.WriteLine(" {0} at position {1}", match.Value, match.Index) - Next - End Sub -End Module -' The example displays the following output: -' Matches for \b(\d{2}-)?(?(1)\d{7}|\d{3}-\d{2}-\d{4})\b: -' 01-9999999 at position 0 -' 777-88-9999 at position 22 -'