MySQL REGEXP + whitespace (\s)

Before MySQL 8.0, MySQL regexes only support the notations listed in §12.7.2 "Regular Expressions" of the MySQL 5.7 Reference Manual (or counterpart for the appropriate version), which include the [[:space:]] notation but not the \s notation. So, you just need to replace each occurrence of \s with [[:space:]].

In MySQL 8.0 and later, MySQL uses the regex support of International Components for Unicode [link], which does include \s [link]; but because MySQL itself uses \ as the escape character within strings, you need to double the backslash, replacing each occurrence of \s with \\s.

Tags:

Mysql

Regex

Json