1

I need to check for the digits that are separated by a . or : or /

I tried this :

select 'test text 30.3 " REGEXP '\d+[:./]\d+' 

but that returned a 0

I tried it in regex test online and it seems to be working fine and matches the '30.3'. Not sure why it's not working in mysql

user3340627
  • 3,023
  • 6
  • 35
  • 80

1 Answers1

2

There's no \d in MySQL, use ranges or :digit: :

SELECT 'test text 30.3' REGEXP '[[:digit:]]+[:./][[:digit:]]+' 
Maen
  • 10,603
  • 3
  • 45
  • 71
  • 1
    `[:./]` should be folowed by `{1}` I think, e.g. `SELECT 'test text 30.3' REGEXP '[[:digit:]]+[:./]{1}[[:digit:]]+' `, because it should mark if seperated by `.`, `:`, `/` and not by e.g. `.:` – arnoudhgz Nov 24 '15 at 11:03