|
-
Sep 14th, 2005, 10:47 AM
#1
Thread Starter
Frenzied Member
Regular Expressions
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
If I have been helpful please rate my post. If I haven't tell me!
-
Sep 14th, 2005, 10:54 AM
#2
Re: Regular Expressions
Add a string start and end anchor to it:
^\d{12,17}$
(I think it's ^ and $, don't have regex here)
-
Sep 14th, 2005, 11:12 AM
#3
Thread Starter
Frenzied Member
Re: Regular Expressions
Bang on Mr Frog!
Cheers
DJ
If I have been helpful please rate my post. If I haven't tell me!
-
Sep 14th, 2005, 11:15 AM
#4
Re: Regular Expressions
Banging on
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|