Preg_match question


Posted on 16th Feb 2014 07:03 pm by admin

I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and the letters A-F.

I have this but it does not work:

Did you know?Explore Trending and Topic pages for more stories like this.

'/^[0-9A-F]{6}$/'
No comments posted yet

Your Answer:

Login to answer
254 Like 34 Dislike
Previous forums Next forums
Other forums

how to validate date using javascript
I need to validate date in textbox using javascript..
The date is must be not greater than TODAY

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

How do I use a global footer..?
If my index.php has a bole bunch of if functions and exit's in them

Data type mismatch
Hi,
I am migrating data from algol to c.I mapped real datatype in algol to double datatype in

How to return to a previous page after running a PHP script
I'm having a bit of a melt down here because I think this should be really easy but can't work it ou

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo tho

PHP5/Zend 2.0 - Resources
PHP5 Snapshots
http://snaps.php.net/

ZEND 2.0 Feature Overview and Design (PDF File

PHP hyperlinks generator
Hi

I need some help to get this done using php:


1 - I have few hyperlinks say 500

Amend code to allow multiple attachments
Hi

I have a php page that allows the user to browse to a file (image) then sumbit, the confi

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash