From 1784ae36134e2b212358c042295ae58cc197bf11 Mon Sep 17 00:00:00 2001 From: GURPREET SINGH Date: Sun, 22 Jun 2025 18:46:32 +0530 Subject: [PATCH 1/2] Fix typo 'earch' to 'search' in TOC entry --- docs/navigate/tools-diagnostics/toc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/navigate/tools-diagnostics/toc.yml b/docs/navigate/tools-diagnostics/toc.yml index 2b615722563a2..e78549125f464 100644 --- a/docs/navigate/tools-diagnostics/toc.yml +++ b/docs/navigate/tools-diagnostics/toc.yml @@ -180,7 +180,7 @@ items: href: ../../core/tools/dotnet-nuget-config-paths.md - name: dotnet pack href: ../../core/tools/dotnet-pack.md - - name: dotnet package add/list/remove/earch + - name: dotnet package add/list/remove/search items: - name: dotnet package add href: ../../core/tools/dotnet-package-add.md From f4e9a16404c96724ddcc104d78873816b472b0f5 Mon Sep 17 00:00:00 2001 From: GURPREET SINGH Date: Thu, 10 Jul 2025 23:23:55 +0530 Subject: [PATCH 2/2] Improve email validation regex to exclude invalid characters like commas --- ...-that-strings-are-in-valid-email-format.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format.md b/docs/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format.md index fa9576c669142..f72c3abdc2fc7 100644 --- a/docs/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format.md +++ b/docs/standard/base-types/how-to-verify-that-strings-are-in-valid-email-format.md @@ -61,17 +61,17 @@ The `IsValidEmail` method merely determines whether the email format is valid fo :::code language="vb" source="snippets/how-to-verify-that-strings-are-in-valid-email-format/vb/RegexUtilities.vb"::: -In this example, the regular expression pattern `^[^@\s]+@[^@\s]+\.[^@\s]+$` is interpreted as shown in the following table. The regular expression is compiled using the flag. - -| Pattern | Description | -|-----------|------------------------------------------------------------------------------------------| -| `^` | Begin the match at the start of the string. | -| `[^@\s]+` | Match one or more occurrences of any character other than the @ character or whitespace. | -| `@` | Match the @ character. | -| `[^@\s]+` | Match one or more occurrences of any character other than the @ character or whitespace. | -| `\.` | Match a single period character. | -| `[^@\s]+` | Match one or more occurrences of any character other than the @ character or whitespace. | -| `$` | End the match at the end of the string. | +In this example, the regular expression pattern `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$` is used, which better reflects common email rules by excluding invalid characters like commas. The regular expression is compiled using the flag. + +| Pattern | Description | +|----------------------|-----------------------------------------------------------------------------| +| `^` | Start of the string | +| `[a-zA-Z0-9._%+-]+` | One or more valid characters in the local part (letters, digits, `.`, `_`, `%`, `+`, `-`) | +| `@` | Matches the at-symbol (`@`) | +| `[a-zA-Z0-9.-]+` | One or more valid domain name characters | +| `\.` | Matches a dot (`.`) | +| `[a-zA-Z]{2,}` | Matches a top-level domain of at least two alphabetical characters | +| `$` | End of the string | > [!IMPORTANT] > This regular expression isn't intended to cover every aspect of a valid email address. It's provided as an example for you to extend as needed.