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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started