From ae7465d7e8832585849f09a99ab4177e83cb1dd6 Mon Sep 17 00:00:00 2001 From: Peter Flynn Date: Tue, 12 Jun 2012 10:20:01 -0700 Subject: [PATCH] Fix #971 (Find in Files treats \n, \r, etc. as regular expressions) -- Escape backslash too (and simplify escaping regexp to use char class instead of |). --- src/search/FindInFiles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search/FindInFiles.js b/src/search/FindInFiles.js index 544a0df679e..0f79cacf16a 100644 --- a/src/search/FindInFiles.js +++ b/src/search/FindInFiles.js @@ -271,7 +271,7 @@ define(function (require, exports, module) { // Query is a string. Turn it into a case-insensitive regexp // Escape regex special chars - query = query.replace(/(\(|\)|\{|\}|\[|\]|\.|\^|\$|\||\?|\+|\*)/g, "\\$1"); + query = query.replace(/([(){}\[\].\^$|?+*\\])/g, "\\$1"); return new RegExp(query, "gi"); }