Provide command to adjust phpunit.xml for code coverage
[lhc/web/wiklou.git] / resources / src / mediawiki.RegExp.js
1 ( function () {
2 /**
3 * @class mw.RegExp
4 */
5 mw.RegExp = {
6 /**
7 * Escape string for safe inclusion in regular expression
8 *
9 * The following characters are escaped:
10 *
11 * \ { } ( ) | . ? * + - ^ $ [ ]
12 *
13 * @since 1.26
14 * @static
15 * @param {string} str String to escape
16 * @return {string} Escaped string
17 */
18 escape: function ( str ) {
19 return str.replace( /([\\{}()|.?*+\-^$\[\]])/g, '\\$1' ); // eslint-disable-line no-useless-escape
20 }
21 };
22 }() );