Skip to content

Commit c7a3e0c

Browse files
authored
Merge pull request #1574 from insin/patch-1
Don't escape hyphens for Regex
2 parents 06033a1 + c43fb67 commit c7a3e0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/jest-util/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const escapePathForRegex = (dir: string) => {
3737
};
3838

3939
const escapeStrForRegex =
40-
(string: string) => string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
40+
(string: string) => string.replace(/[[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
4141

4242
const replacePathSepForRegex = (string: string) => {
4343
if (path.sep === '\\') {

0 commit comments

Comments
 (0)