From c43fb67ba0865b6fd3de6acca31790545fc1fd8f Mon Sep 17 00:00:00 2001 From: Jonny Buchanan Date: Fri, 2 Sep 2016 12:20:09 +1000 Subject: [PATCH] Don't escape hyphens for Regex --- packages/jest-util/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-util/src/index.js b/packages/jest-util/src/index.js index 8f1c47874e6a..30a786859192 100644 --- a/packages/jest-util/src/index.js +++ b/packages/jest-util/src/index.js @@ -37,7 +37,7 @@ const escapePathForRegex = (dir: string) => { }; const escapeStrForRegex = - (string: string) => string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + (string: string) => string.replace(/[[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); const replacePathSepForRegex = (string: string) => { if (path.sep === '\\') {