I want to run a query in mysql which will return the record where the first 4 digits are '0123' or '0798' from the following column:
Number |
---|
0123 427 6465 |
0123 1451 |
01 23 46 47 |
0123 945675 |
07984 473456 |
0845 46 47 |
(012377) 5258 |
0800 586931 |
012 3668 6098 |
0 1238592371 |
I want the query to return all records where '0123' or '0798' are the first 4 numeric characters regardless of if there are other characters before or in between. E.g. I would want record 7 returned even though '0123' is in brackets. And I would want record 10 returned even though it is written as '0 123' i.e. there is a space in between.
Is regex relevant here? If so, what would the regex expression be?