Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/core/additional-tools/uninstall-tool-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:

Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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(?<n2>\d{2}-)?(?(n2)\d{7}|\d{3}-\d{2}-\d{4})\b` is interpreted as shown in the following table:

Expand All @@ -134,8 +134,8 @@ The regular expression pattern `\b(?<n2>\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

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Text.RegularExpressions;

// <EitherOrCharacterClass>
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}");
// </EitherOrCharacterClass>

Console.WriteLine();

// <EitherOrPatterns>
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}");
// </EitherOrPatterns>

Console.WriteLine();

// <ConditionalExpression>
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}");
// </ConditionalExpression>

Console.WriteLine();

// <ConditionalNamedGroup>
string namedGroupPattern = @"\b(?<n2>\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}");
// </ConditionalNamedGroup>

Console.WriteLine();

// <ConditionalNumberedGroup>
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}");
// </ConditionalNumberedGroup>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Imports System.Text.RegularExpressions

Module Program
Sub Main(args As String())
' <EitherOrCharacterClass>
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
' </EitherOrCharacterClass>

Console.WriteLine()

' <EitherOrPatterns>
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
' </EitherOrPatterns>

Console.WriteLine()

' <ConditionalExpression>
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
' </ConditionalExpression>

Console.WriteLine()

' <ConditionalNamedGroup>
Dim namedGroupPattern As String = "\b(?<n2>\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
' </ConditionalNamedGroup>

Console.WriteLine()

' <ConditionalNumberedGroup>
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
' </ConditionalNumberedGroup>
End Sub
End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>vb</RootNamespace>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

</Project>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading