I have strings of 010xxx, 011xxx, 110xxx, 111xxx, Q10xxx, Q11xxx in a field along with other values that are not similar. They might be XyzABC.
I have two regex patterns that separately give results that are good: [1Q]_[0-9]% and 0_[1-9]%
In words return true if
first letter is 1 or Q and the 3rd letter is a 0-9
OR
the first letter is 0 and the third letter is 1-9
How do I create a search pattern that does the OR either using SIMILAR TO or regex?
One version that works by itself is:
SELECT field FROM db WHERE field SIMILAR TO '[1Q]_[0-9]%'
Not wedded to SIMILAR or regex. They were just what I could get working until I tried to or them. Open to other suggestions.