What problem are you having with that. AFAIK it should work the same. i.e. capture a number or whitespace character appearing before a dollar sign.
var pattern = /^\d+ ?$/;
Though that says the pattern must start with a number.
With regexes it's better to try to really know specifically what you're matching.
*edit I misread the $ in the first post. Mittineague caught it.
:d'oh: I may have seen the escaped literal $ sign, but I should have said "match" not "capture".