For example, I have a table "example" which has a column "col1" with string like below
some example text here x2.0.3-a abc
some other example text 1.5 abc
another example text 0.1.4 mnp
some other example text abc
another example text mnp
I want to select those rows that matches a regular expression. I want the regular expression something like this
any string.any string.any string space abc/mnp
or any string.any string space abc/mnp
that is the regular expression should match two or three dots, before and after of each dot there should be at least one string(char/number/special chars) and then a single space and then at the end either abc/mnp
. What will be the regular expression and sql query for this?
I am not sure if i got your question right , but in case if you are looking to select columns which has any.any or any.any.any in your column then the below regex can help
^.*?(\S+\.\S+).*[ ](?:abc|mnp)$
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.