From 528889054aa2040bb36b4b37b70829712f2e988f Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Wed, 30 Jun 2021 17:28:00 -0600 Subject: [PATCH 1/2] Fix RegexOptions.IgnorePatternWhitespace # to EOL The documentation currently states that > All text in the regular expression pattern from the # character to the > end of the string is interpreted as a comment. when `RegexOptions.IgnorePatternWhitespace` is in effect. This omits the fact that `#` behaves as a line comment when the pattern contains multiple lines. It causes the text from `#` to the end of the line, denoted by `\n`, to be interpreted as a comment. For example: ```csharp using System.Text.RegularExpressions; Console.WriteLine(Regex.Match( "Hello World", "Hello # Line Comment\n\\sWorld", RegexOptions.IgnorePatternWhitespace)); ``` Prints "Hello World", rather than "Hello" as it does if `\n` is removed or replaced by `\r`. This commit adds this behavior to the documentation. Signed-off-by: Kevin Locke --- docs/standard/base-types/regular-expression-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/base-types/regular-expression-options.md b/docs/standard/base-types/regular-expression-options.md index bce5f380d350d..e9d4c38afd510 100644 --- a/docs/standard/base-types/regular-expression-options.md +++ b/docs/standard/base-types/regular-expression-options.md @@ -251,7 +251,7 @@ The option: From 44c68e5fd6c78c9d241e4c3c4233a52c3c0e31a9 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Tue, 6 Jul 2021 09:17:01 -0700 Subject: [PATCH 2/2] Update regular-expression-options.md --- docs/standard/base-types/regular-expression-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/base-types/regular-expression-options.md b/docs/standard/base-types/regular-expression-options.md index e9d4c38afd510..cee40b4ec53fe 100644 --- a/docs/standard/base-types/regular-expression-options.md +++ b/docs/standard/base-types/regular-expression-options.md @@ -251,7 +251,7 @@ The option: