diff --git a/src/Workspaces/Core/Portable/EmbeddedLanguages/RegularExpressions/RegexLexer.cs b/src/Workspaces/Core/Portable/EmbeddedLanguages/RegularExpressions/RegexLexer.cs index c8667b363757385870209128167f0e146b451761..099b92f04c0647939c5fa80396cdcfdb2cf1c62e 100644 --- a/src/Workspaces/Core/Portable/EmbeddedLanguages/RegularExpressions/RegexLexer.cs +++ b/src/Workspaces/Core/Portable/EmbeddedLanguages/RegularExpressions/RegexLexer.cs @@ -280,11 +280,6 @@ private static bool IsEscapeCategoryChar(VirtualChar ch) return null; } - if (!IsDecimalDigit(this.CurrentChar)) - { - return null; - } - const int MaxValueDiv10 = int.MaxValue / 10; const int MaxValueMod10 = int.MaxValue % 10; @@ -308,6 +303,11 @@ private static bool IsEscapeCategoryChar(VirtualChar ch) } } + if (Position == start) + { + return null; + } + var token = CreateToken(RegexKind.NumberToken, ImmutableArray.Empty, GetSubPatternToCurrentPos(start)); token = token.With(value: value);