Why does Visual Studio use such a strange regex syntax

前端 未结 4 1523
长发绾君心
长发绾君心 2020-12-05 17:35

Is there any reason why Visual Studio uses such a strange syntax (for instance in the search/replace dialog)?

Instead of writing \\s*(\\w+) = new Process\\(\\)

4条回答
  •  旧时难觅i
    2020-12-05 18:10

    I quote Coding Horror:

    However, you're in for an unpleasant surprise when you attempt to actually use regular expressions to find anything in Visual Studio. Apparently the Visual Studio IDE has its own bastardized regular expression syntax. Why? Who knows. Probably for arcane backwards compatibility reasons, although I have no idea why you'd want to perpetually carry forward insanity. Evidently it makes people billionaires, so who am I to judge.

    http://www.codinghorror.com/blog/2006/07/the-visual-studio-ide-and-regular-expressions.html

提交回复
热议问题