I was reading this SO post on excluding cases with a given string.
The selected answer there uses ^((?!hede).)*$
to exclude string 'hede'.
I have strings like the following:
apples_IOS_QA
apples_Android_QA
oranges
bananas
banannas_QA
apples_Android
apples_IOS
QA_apples_IOS // note sometimes 'QA' is at the beginning of the string
I'd like to return non QA versions of apples.
Tried (Within. Presto SQl Query):
and regexp_like(game_name, '^((?!QA).*$^apples.*)')
No results returned
Then tried:
and regexp_like(game_name, '^apples.*(!?QA)')
This runs and returns apples but gives me QA results only when in fact I wanted to exclude those results.
Then tried:
and regexp_like(game_name, '^apples.*[^(QA)]')
This returns apples results only but includes those with string 'QA' within them.
How can I regex filter to include 'apples' but exclude any cases that contain sub string 'QA'?