Import: Handle uploads with sha1 starting with 0 properly
[mediawiki.git] / resources / src / mediawiki / mediawiki.template.regexp.js
blob3ec0a1f5c95f3e9cd1f034e3afaeeb78256dc6c0
1 mediaWiki.template.registerCompiler( 'regexp', {
2         compile: function ( src ) {
3                 return {
4                         render: function () {
5                                 return new RegExp(
6                                         src
7                                                 // Remove whitespace
8                                                 .replace( /\s+/g, '' )
9                                                 // Remove named capturing groups
10                                                 .replace( /\?<\w+?>/g, '' )
11                                 );
12                         }
13                 };
14         }
15 } );