Jump to content

specific characters


davey10101

Recommended Posts

Hi,  I'm trying to do a regex so that a string can only contain the following

 

ABCDEIMSw4

 

and be 2 to 7characters long

 

I've tried the following

 

if(!preg_match("/^[ABCDEIMSw4]{2,7}$/",$data[5])){
         echo "INVALID ";

 

which fails if $data[5] is 'IC'

 

can anyone help?

 

cheers.

Link to comment
https://forums.phpfreaks.com/topic/194149-specific-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.