Reputation: 557
ABCD9876S__9999.A001
ABCD9876S__9999.A002
I want to catch the above two strings using reg ex
I have :
ABCD.*9999\.A00[12]
This doesn't work in Postgres. How do I convert this? Is there an online tool?
Upvotes: 0
Views: 291
Reputation: 163632
You could specify the character ranges that you want to allow using a character class and add the double undescore you want to be part of the match.
ABCD[a-zA-Z0-9]+__9999\.A00[12]
If the match should be from the start of the string use anchors ^
and $
See a postgre sql demo 1 | demo 2 using regexp_matches
Upvotes: 2