While working through prepared statements in MySQL, there was an interesting MySQL regular expression question raised. A student wanted to know how to address the following error message:
ERROR 1139 (42000): Got error 'repetition-operator operand invalid' FROM REGEXP
They had substituted * for a .+ in a
metasequence. A metasequence is a parenthetical expression that
evaluates based on multiple alternative conditions, and the pipe
(|) acts as an OR operator. The full
code example is found on page 482 of the Oracle Database 11g & MySQL 5.6 Developer
Handbook. The student’s change would have worked without an …