I'm using the below UPDATE statement to update a flag that confirms if a Code is correctly formatted, note the code can be anywhere in 'RefCode'. This works in Excel, but I understand MySQL REGEX is a little different to standard REGEX:
UPDATE tblRequests
SET flagIsRefCodeOK= (RefCode REGEXP '^[A-Z0-9]{8}-(?:[A-Z0-9]{4}-){3}[A-Z0-9]{12}$')
WHERE DataSetID=11;
In a nut shell, it should be true/[1] if the field contains ddda999d-99de-999e-999e-9b9bf9999999:
8 alphanumeric characters
A SINGLE DASH
4 alphanumeric characters
A SINGLE DASH
4 alphanumeric characters
A SINGLE DASH
4 alphanumeric characters
A SINGLE DASH
12 alphanumeric characters
Would appreciate any assistance with this.
Thnx