Skip to content

Instantly share code, notes, and snippets.

javascript:found = location.toString().match(/^(.*?)(0*)(\d+)([^\d]*)$/);if (found) {var o = found[2];var n = found[3];var n1 = String(Number(n) + 1);if (n.length < n1.length) { o = o.substring(0, o.length-1);}location = (found[1] + o + n1 + found[4]);} else {alert('no number found in ' + location);}
@AliG378
AliG378 / bookmark.js
Created August 21, 2018 22:43 — forked from melhesedek/bookmark.js
"url increment ☛" bookmarklet
javascript:a = document.URL.split(/(\d+)/g); for (i = a.length-1; i >= 0; --i) { if (a[i].match(/\d+/)) { a[i]++; break; } }; window.location.assign( a.join('') )