MYSQL: Validate Input Values in Specific Format within a FUNCTION

MYSQL: Validate Input Values in Specific Format within a FUNCTION

i have one question with regard to MYSQL. I want to create a function that is able to check whether an Input is given in a specific format.

i have one question with regard to MYSQL. I want to create a function that is able to check whether an Input is given in a specific format.

The output should be in the following shape:

***x x (a) n (n) (n) (n)
with :
x = letters and numbers
n = numbers
a = letters
brackets = optional Values***

my code is written below this.

CREATE FUNCTION validate_of_number(testnumber VARCHAR(7))
RETURNS INT
DETERMINISTIC
RETURN
    CASE
        WHEN
            (SELECT * FROM flightexecution WHERE FlightNo REGEXP 
            '^[[:alnum:]+[:alnum:]] + [[:alpha:]|''] + [:digit:] + 
            [[:digit:]|''] + [[:digit:]|''] + [[:digit:]|'']') > 0
            Then 1
            Else 0
            END;`

However, it does not work and i donĀ“t know why. The Output is just a 'OK' without any further information.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

MySQL Database Bootcamp: Go from SQL Beginner to Expert | Simpliv

MySQL Database Bootcamp: Go from SQL Beginner to Expert

SQL Full Course - SQL Tutorial For Beginners - MySQL Essentials - SQL Training

This SQL Full Course video will cover all the topics of SQL starting from scratch. This video is great for beginners who want to learn SQL and for advanced people to brush up their skills.

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts|Simpliv

Learn to Build SQL Query| Ultimate SQL and DataBase Concepts