(s)
| 804 | |
| 805 | // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript |
| 806 | function unescapeFormat(s) { |
| 807 | return regexEscape( |
| 808 | s |
| 809 | .replace('\\', '') |
| 810 | .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function ( |
| 811 | matched, |
| 812 | p1, |
| 813 | p2, |
| 814 | p3, |
| 815 | p4 |
| 816 | ) { |
| 817 | return p1 || p2 || p3 || p4; |
| 818 | }) |
| 819 | ); |
| 820 | } |
| 821 | |
| 822 | function regexEscape(s) { |
| 823 | return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); |
no test coverage detected