We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4d727f commit 481b5d5Copy full SHA for 481b5d5
lib/rdoc/generator/template/json_index/js/searcher.js
@@ -58,7 +58,12 @@ Searcher.prototype = new function() {
58
59
function buildRegexps(queries) {
60
return queries.map(function(query) {
61
- return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i');
+ var pattern = [];
62
+ for (var i = 0; i < query.length; i++) {
63
+ var char = RegExp.escape(query[i]);
64
+ pattern.push('([' + char + '])([^' + char + ']*?)');
65
+ }
66
+ return new RegExp(pattern.join(''), 'i');
67
});
68
}
69
0 commit comments