There goes my regex crown
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Discord
|
|||||||
static Format()
|
static Format()
|
||||||
{
|
{
|
||||||
const string innerPattern = "[_*]|~~";
|
const string innerPattern = "[_*]|~~";
|
||||||
_escapeRegex = new Regex($@"(?:^|\W)(?:{innerPattern})|(?:{innerPattern})(?:\W|$)|\\", RegexOptions.Compiled);
|
_escapeRegex = new Regex($@"(?<=^|\W)(?:{innerPattern})|(?:{innerPattern})(?=\W|$)|\\", RegexOptions.Compiled);
|
||||||
_escapeEvaluator = new MatchEvaluator(e => '\\' + e.Value);
|
_escapeEvaluator = new MatchEvaluator(e => '\\' + e.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user