Anyone out there any good at regular expressions?

I need to check that an input only contains digits and is between 12 and 17 digits in length.

I thought \d{12,17} would work but it only ensures there are between 12 and 17 digits grouped together i.e. if you append or preppend (is that a word?) other characters then it slips through.

Help!

DJ