Question: Regular Expressions For a reference to be valid, the server-side should validate the reference to the same format as the client-side, plus the following additional

Regular Expressions

For a reference to be valid, the server-side should validate the reference to the same format as the client-side, plus the following additional constraints: the four letter group must be one of ACFT, ABQR, BXDE. Anything else is invalid. The next character must be a hyphen. Anything else is invalid.

The first digit may only be 1 or 2. The other digits may be any value between 0 and 9 inclusive.

My code below that needs help so it matches with what is asked above. Can i have help plz.

if (isset($webdata['bookingreference'] )) {

if (!preg_match("/^[a-z A-Z]{4}-[0-9]{5}$/",$webdata['bookingreference'])) {

$formerror['bookingreference'] = 'Not valid on server: invalid bookingreference format ';

//echo "invalid bookingreference format";

$valid = FALSE ;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!