lib/fileprocessor.js
function (template) {
    var pattern = _.template(template)(fileReplace);
    pattern = pattern.replace(/\//g, '\\/');
    pattern = pattern.replace(/\s+/g, '\\s*');
    pattern = '\\s*' + pattern + '\\s*';
    return new RegExp(pattern);
}
function (template) {
    var pattern = _.template(template)(fileReplace);
    pattern = pattern.replace(/\//g, '\\/');
    pattern = pattern.replace(/\s+/g, '\\s*');
    pattern = '\\s*' + pattern + '\\s*';
    return new RegExp(pattern);
}
function ( template ) { var pattern = _ . template ( template ) ( fileReplace ) ; pattern = pattern . replace ( / \/ / g , '\\/' ) ; pattern = pattern . replace ( / \s+ / g , '\\s*' ) ; pattern = '\\s*' + pattern + '\\s*' ; return new RegExp ( pattern ) ; }
Convert the template into a RegExp that can capture the file name.
@param {string} template
@returns {RegExp} A regular expression that can capture the file name.
Convert the template into a RegExp that can capture the file name .