kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Getting ready for using RegExp for search
So that we can do case insensitivity and partial matchesprint-window-tiddler
rodzic
81a565e608
commit
5e2c3db385
|
@ -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") {
|
||||
|
|
Ładowanie…
Reference in New Issue