var thepage = /(\d+)/i.exec(window.location.href);
var thepage = /(\d+)/i.exec(window.location.href); alert(thepage[1]);
var thepage = /(\d+)\.htm/i.exec(window.location.href);
var thepage = /\d+(?=\.htm)/i.exec(window.location.href);
That works perfectly. Thanks!
Matt: fwiw (apparently not much), there are no other numbers in the url. That's probably the first javascript re I tried to write from scratch, as opposed to plagiarize + hack.