Getting ready for using RegExp for search

So that we can do case insensitivity and partial matches
print-window-tiddler
Jeremy Ruston 2012-10-17 19:10:48 +01:00
rodzic 81a565e608
commit 5e2c3db385
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -221,6 +221,13 @@ exports.stringify = function(s) {
.replace(/[\x80-\uFFFF]/g, exports.escape); // non-ASCII characters
};
/*
Escape the RegExp special characters with a preceding backslash
*/
exports.escapeRegExp = function(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')
};
exports.nextTick = function(fn) {
/*global window: false */
if(typeof window !== "undefined") {