MariaDB regex working in online regex testers does not work in SELECT WHERE REGEXP
You may use
REGEXP '\\bJ'
^^^
Here, the \b
is a word boundary that will force a match only when J
is not preceded with a letter, digit or _
.
The \
is doubled because the regex engine expects a literal \
, and two backslashes are required.