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

2

1 Answer 1

2

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

SELECT 'test text 30.3' REGEXP '[[:digit:]]+[:./][[:digit:]]+' 
Sign up to request clarification or add additional context in comments.

1 Comment

[:./] 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. .:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.