1

How would the regexp_extract change if this data was in a column named "pages" and I want for every row that has ':old:yes:' to return the string after 'yes:' and before the next string?

PAGES (table name)

hello:ok:old:yes:age:test:jack   
hello:no:old:yes:hour:black:nancy   
hi:fine:old:yes:minute:white:jason   

As you can see ':old:yes:' is my starting point and i want the regexp_extract to return the next text before the colon. In the above example I would want the following results:

age  
hour  
minute 

1 Answer 1

2
select  regexp_extract(page,':old:yes:([^:]+)',1)
from    pages
where   page like '%:old:yes:%'

+--------+
| age    |
| hour   |
| minute |
+--------+
Sign up to request clarification or add additional context in comments.

1 Comment

Can you help with this question: stackoverflow.com/questions/46370135/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.