escapeRegExp.js 224 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 define(['../lang/toString'], function(toString) { /** * Escape RegExp string chars. */ function escapeRegExp(str) { return toString(str).replace(/\W/g,'\\$&'); } return escapeRegExp; });