提交 cd952504 编写于 作者: C Cyrus Najmabadi

Speed up regex comment detector pattern.

上级 9e786147
......@@ -43,7 +43,7 @@ internal sealed class RegexPatternDetector
/// Option names are the values from the <see cref="RegexOptions"/> enum.
/// </summary>
private static readonly Regex s_languageCommentDetector =
new Regex(@"\blang(uage)?\s*=\s*regex(p)?\b((\s*,\s*)(?<option>[a-zA-Z]+))*",
new Regex(@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*regex(p)?\b((\s*,\s*)(?<option>[a-zA-Z]+))*",
RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Dictionary<string, RegexOptions> s_nameToOption =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册