If you don't wrap your pattern in parentheses, you wont be unnecessarily capturing the content into group 1, and thus wont get two items in your array.
(You only need a capturing group when you need
part of an expression, because the whole match is always captured.)
As Matt points out, just grabbing any sequence of numerical digital is possibly not specific enough.
However, I would probably do it this way instead:
javascript code:
var thepage = /\d+(?=\.htm)/i.exec(window.location.href);
And then you can either access
thepage[0], or let it be converted to a string, and you'll have the number you want, only once.
EDITED: 22 Apr 2012 19:31 by BOUGHTONP