How to get the result ‘xxx’ from blanket [ ] in presto. I can’t find the proper regexp to fix my problem
select aaa_[xxx]
Could you help me out?
Thank you
Advertisement
Answer
If you have strings like this: and want to extract substring between square brackets, use this:
select regexp_extract('aaa_[xxx]','.*?[(.*?)]',1) --returns xxx