| /* |
| * Regular expressions. Some of these are stupidly long. |
| */ |
| |
| /*jshint maxlen:1000 */ |
| |
| "use string"; |
| |
| // Unsafe comment or string (ax) |
| exports.unsafeString = |
| /@cc|<\/?|script|\]\s*\]|<\s*!|</i; |
| |
| // Unsafe characters that are silently deleted by one or more browsers (cx) |
| exports.unsafeChars = |
| /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; |
| |
| // Characters in strings that need escaping (nx and nxg) |
| exports.needEsc = |
| /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; |
| |
| exports.needEscGlobal = |
| /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; |
| |
| // Star slash (lx) |
| exports.starSlash = /\*\//; |
| |
| // Identifier (ix) |
| exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; |
| |
| // JavaScript URL (jx) |
| exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; |
| |
| // Catches /* falls through */ comments (ft) |
| exports.fallsThrough = /^\s*\/\*\s*falls\sthrough\s*\*\/\s*$/; |