(str)
| 129 | |
| 130 | // http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex |
| 131 | function escapeRegExp(str) { |
| 132 | return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); |
| 133 | } |
| 134 | |
| 135 | function hasClass(el, className) { |
| 136 | var re = new RegExp("\\b" + escapeRegExp(className) + "\\b"); |