mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
do not wrap regular expresssions in '^' and '$', only strings.
This commit is contained in:
1 parent
37f4ffd324
commit
fccdb12b02
3 files changed
+6
-3
No files matched your search
@@ -106,14 +106,16 @@ define(function (require, exports, module) {
|
||||
// since we know it is a wildcard.
|
||||
value = value.replace("\\?", ".?");
|
||||
value = value.replace("\\*", ".*");
|
||||
|
||||
// Add "^" and "$" to prevent matching in the middle of strings.
|
||||
value = "^" + value + "$";
|
||||
}
|
||||
|
||||
if (index > 0) {
|
||||
regExpString += "|";
|
||||
}
|
||||
|
||||
// Add "^" and "$" to prevent matching in the middle of strings.
|
||||
regExpString = regExpString.concat("^" + value + "$");
|
||||
regExpString = regExpString.concat(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"excluded-directories" : ["excluded-dir1", "/excluded-dir2-[\\d]/"],
|
||||
"excluded-directories" : ["excluded-dir1", "/^excluded-dir2-[\\d]$/"],
|
||||
"excluded-files" : ["file1?.js", "file2*.js", "file3.js", "/file4[x|y|z]?.js/"],
|
||||
"max-file-count": 512,
|
||||
"max-file-size": 100000
|
||||
|
||||
@@ -1449,6 +1449,7 @@ define(function (require, exports, module) {
|
||||
expect(excludedFiles.test("file4z.js")).toBeTruthy();
|
||||
expect(excludedFiles.test("file4b.js")).toBeFalsy();
|
||||
expect(excludedFiles.test("file4xyz.js")).toBeFalsy();
|
||||
expect(excludedFiles.test("xfile4.js")).toBeTruthy();
|
||||
|
||||
// test builtin exclusions are also present
|
||||
expect(excludedFiles.test("require.js")).toBeTruthy();
|
||||
|
||||
Reference in new issue
Block a user