I am trying to pull the latest revision number using a regular expression that is not working. Could someone helped a novice regexer with this:
revision: 2020
stdout.match(/^r(\d+)/m)[1])
Thank you for any help you can give
EDIT
I should have put my whole task here so all would know what I am trying to do.
grunt.registerTask('version', 'Updating to latest revision',
function () {
var done = this.async();
grunt.util.spawn({
cmd: 'svn info',
args: ['-r HEAD']
}, function (err, result, code) {
var output = result.stdout;
if (output) {
var revision = result.stdout.match(/\d+/)[0];
grunt.file.write('web/version2.js', 'var UIVERSION = ' + revision);
}
done();
});
}
);