I have stored values in my database that look like 5XXXXXX, where X can be any digit. In other words, I need to match incoming SQL query strings li
5XXXXXX
X
In order to match a digit, you can use [0-9].
[0-9]
So you could use 5[0-9][0-9][0-9][0-9][0-9][0-9] and [0-9][0-9][0-9][0-9]7[0-9][0-9][0-9]. I do this a lot for zip codes.
5[0-9][0-9][0-9][0-9][0-9][0-9]
[0-9][0-9][0-9][0-9]7[0-9][0-9][0-9]