?
Solved

6 digit reg expression

Posted on 2006-04-05
5
Medium Priority
?
357 Views
Last Modified: 2008-03-06
What's a regular expression for a 6-digit alphanumeric string
0
Comment
Question by:weikelbob
5 Comments
 
LVL 3

Expert Comment

by:spotx
ID: 16379007
Using POSIX Extended regular expressions

for ereg based functions use "[0-9a-zA_Z]{6,6}"
for eregi based functions use "[0-9a-z]{6,6}"
0
 
LVL 3

Accepted Solution

by:
spotx earned 400 total points
ID: 16379154
Sorry typo should have read A-Z not A_Z

 Using POSIX Extended regular expressions

for ereg based functions use "[0-9a-zA-Z]{6,6}"
for eregi based functions use "[0-9a-z]{6,6}"

      
0
 
LVL 9

Assisted Solution

by:blue_hunter
blue_hunter earned 400 total points
ID: 16383218
[a-zA-Z0-9]{6}
0
 
LVL 9

Assisted Solution

by:tolgaong
tolgaong earned 400 total points
ID: 16485369
if (eregi('^[a-z0-9]{6}$', $alphanumericvalue))  echo "its alphanumeric";
else echo "its not alphanumeric";
0
 
LVL 7

Author Comment

by:weikelbob
ID: 16493037
Thank you guys.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question