In addition to a data type of VARCHAR(255)
, I'd like to add a constraint to the data by a regular expression, e.g. [a-zA-Z ]
.
I'd like to be able to query the regex, like how I can query meta data in the information_schema
.
I've seen some related posts, but not exactly what I'm looking for. I've seen: Restrict varchar() column to specific values? which shows how to use constaints, and I've seen via triggers here: Is it Possible to Enforce Data Checking in MySQL using Regular expression
Can RegExs be used as constraints and those constraints be queried? If so, how?