The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

My regexp skills are a little rusty but I think you can do the following...

The following pattern will match if the string being tested against it contains only digits:

var reNum = /^\d+$/ig; // only digits allowed

As you probably already know, the \d is the meta character for a digit and the + sign means "at least one of and possibly more". The ^ character means the pattern must match from the very start of the string being tested and the $ sign says it must match right up to the very end. So here we are saying the string must only contain at least one or more digits form begining to end. If you want to allow an empty field you could swap the + for a * which means zero or more of whatever it follows.