We help IT Professionals succeed at work.

6 digit reg expression

weikelbob
weikelbob asked
on
Medium Priority
391 Views
Last Modified: 2008-03-06
What's a regular expression for a 6-digit alphanumeric string
Comment
Watch Question

Commented:
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}"
Commented:
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}"

      

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
blue_hunterTechnical Lead
CERTIFIED EXPERT
Commented:
[a-zA-Z0-9]{6}
Commented:
if (eregi('^[a-z0-9]{6}$', $alphanumericvalue))  echo "its alphanumeric";
else echo "its not alphanumeric";

Author

Commented:
Thank you guys.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.