Skip to content

Instantly share code, notes, and snippets.

@negipo
Created November 25, 2014 13:17
Show Gist options
  • Select an option

  • Save negipo/2675c6f64271337d26e1 to your computer and use it in GitHub Desktop.

Select an option

Save negipo/2675c6f64271337d26e1 to your computer and use it in GitHub Desktop.
javascript:location.href = location.href.replace(/(\d+)(.*?)$/, function(m){
var num = arguments[1];
var tail = arguments[2];
var span = num.length;
var next = parseInt(num, 10) + 1;
return ('00000' + next).slice(-span) + tail;
});void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment