Reputation:
I won't found data from table who start following by CR and one space and 4 to 6 number
Query
SELECT `order_det_ref_no` FROM `manufacturers_order` WHERE
`order_det_ref_no` REGEXP '%^CR\s+\b\w{4,6}$%'
Upvotes: 0
Views: 50
Reputation: 627607
MySQL regex does not use regex delimiters, nor does it support \b
(it uses [[:<:]]
for a word start position and [[:>:]]
for a word end), \s
, \w
regex shorthand classes. Use
REGEXP '^CR[[:space:]]+[[:alnum:]_]{4,6}$'
Note that [[:space:]]
matches both horizontal and vertical whitespace, you may use [[:blank:]]
if you also need to only match horizontal whitespace.
Upvotes: 1