mw.test.addTest( 'typeof $.escapeRE',
'function (string)' );
- mw.test.addTest( '$.escapeRE( ".st{e}$st" )',
- '\\.st\\{e\\}\\$st (string)' );
+ mw.test.addTest( '$.escapeRE( "<!-- ([{+mW+}]) $^|?>" )',
+ '<!\\-\\- \\(\\[\\{\\+mW\\+\\}\\]\\) \\$\\^\\|\\?> (string)' ); // double escaped
+
+ mw.test.addTest( '$.escapeRE( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" )',
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ (string)' );
+
+ mw.test.addTest( '$.escapeRE( "abcdefghijklmnopqrstuvwxyz" )',
+ 'abcdefghijklmnopqrstuvwxyz (string)' );
+
+ mw.test.addTest( '$.escapeRE( "0123456789" )',
+ '0123456789 (string)' );
mw.test.addTest( 'typeof $.isEmpty',
'function (string)' );
return str.substr( 0, 1 ).toUpperCase() + str.substr( 1, str.length );
},
escapeRE : function( str ) {
- return str.replace ( /([\\{}()|.?*+-\^$\[\]])/g, "\\$1" );
+ return str.replace ( /([\\{}()|.?*+\-^$\[\]])/g, "\\$1" );
},
// $.isDomElement( document.getElementById('content') ) === true
// $.isDomElement( document.getElementsByClassName('portal') ) === false (array)