Reputation: 51039
The following query
SELECT "T2N1M0" REGEXP "^T[:digit:].*";
returns single row with 0
for me.
I would expect it return 1
.
What I am doing wrong?
Upvotes: 1
Views: 790
Reputation: 91942
You are missing one level of square brackets []
:
SELECT "T2N1M0" REGEXP "^T[[:digit:]].*";
You should have gotten this error message that hints at the problem:
Got error 'POSIX named classes are supported only within a class at offset ' from regexp
More one the syntax for regular expressions are given by the manual page 13.5.2 Regular Expressions.
Upvotes: 2