diff --git a/docs/document/Regular Expression/docs/1. Basics/1. Match Literals.md b/docs/document/Regular Expression/docs/1. Basics/1. Match Literals.md index 7e6f793f..655bc717 100644 --- a/docs/document/Regular Expression/docs/1. Basics/1. Match Literals.md +++ b/docs/document/Regular Expression/docs/1. Basics/1. Match Literals.md @@ -8,7 +8,7 @@ Regex is case-sensitive by default, to ignore case, add leading `(?i)`. :::code-group -```regex +```regexp (?i)ascii ``` @@ -21,6 +21,6 @@ _ = new Regex(@"ascii", RegexOptions.IgnoreCase) To partially ignore case, close partial regex using `(?i)(?-i)` The following matches `ASCIIascciiascii` but not `asciiasciiASCII` -```regex +```regexp ASCII(?i)aScIi(?-i)ascii ``` diff --git a/docs/document/Regular Expression/docs/1. Basics/3. Match One of Many Characters.md b/docs/document/Regular Expression/docs/1. Basics/3. Match One of Many Characters.md index 2af1eb68..5abc3362 100644 --- a/docs/document/Regular Expression/docs/1. Basics/3. Match One of Many Characters.md +++ b/docs/document/Regular Expression/docs/1. Basics/3. Match One of Many Characters.md @@ -4,7 +4,7 @@ Create a *character class* to match one occurrence inside a `[]` -```regex +```regexp c[ae]l[ae]nd[ae]r ``` @@ -14,7 +14,7 @@ Create a certain range using `-` Match one of hexadecimal characters: -```regex +```regexp [a-fA-F0-9] ``` @@ -26,7 +26,7 @@ Negate a range using leading `^` Match Non-hexadecimal characters: -```regex +```regexp [^a-fA-F0-9] ``` @@ -40,13 +40,13 @@ There's four special characters may need to be escaped: For any character that are not one of above, is not required to be escaped: -```regex +```regexp [$()*+.?{|] ``` For `^`s not act as negation are not required to be escaped: -```regex +```regexp [a-f^A-F\^0-9] ``` diff --git a/docs/document/Regular Expression/docs/1. Basics/5. Match Start and End of Line.md b/docs/document/Regular Expression/docs/1. Basics/5. Match Start and End of Line.md index 44f081ab..c76cbfc2 100644 --- a/docs/document/Regular Expression/docs/1. Basics/5. Match Start and End of Line.md +++ b/docs/document/Regular Expression/docs/1. Basics/5. Match Start and End of Line.md @@ -9,10 +9,10 @@ _ = new Regex(@"^abcefg$", RegexOptions.Multiline); ``` -> `^` always matches after `\n`, so `\n^` is redundant -> `$` always matches before `\n`, so `$\n` is redundant -> `\A\Z` matches empty string and empty string with a single new line -> `\A\z` matches only empty string +- `^` always matches after `\n`, so `\n^` is redundant +- `$` always matches before `\n`, so `$\n` is redundant +- `\A\Z` matches empty string and empty string with a single new line +- `\A\z` matches only empty string :::tip Always use `\A` and `\Z` instead of `^` and `$` when to match start/end of a whole string