Question
I have created a client side validation of $format = /^[a-zA-Z]{3}-[0-9]{6}/; This is to validate a booking reference such as ABC-123456. I must now create
I have created a client side validation of $format = "/^[a-zA-Z]{3}-[0-9]{6}/"; This is to validate a booking reference such as ABC-123456.
I must now create a server side validation. The initial 3 letters ust be either 'ACF', 'ABQ' or 'BXD'. The next character is again a hyphen '-'. The 6 numbers allowed must beging with either a 6 or a 9. Below is the question requirements:
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 three letter group must be one of ACF, ABQ, BXD. Anything else is invalid.
The next character must be a hyphen. Anything else is invalid.
The first digit may only be 6 or 9. The other digits may be any value between 0 and 9 inclusive.
Could you please assist with the code for this?
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