Fix regex dot escape

This commit is contained in:
Maximilian Krög
2020-02-15 10:59:26 +01:00
parent ccafb4b91d
commit b613e8e77f

View File

@@ -12,7 +12,7 @@ $(function () {
} catch (e) {
}
// In case of invalid regexp fall back to non-regexp, but still allow . to match /
return makeRe(searchTerm.replace(/\./g, '/').replace(/[.*+?^${}()|[\]\\]/g, '\\$&'));
return makeRe(searchTerm.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/\\\./g, '[./]'));
}
function getWeightFunction(searchTerm, allowRegex) {