Learner1
Learner1

Reputation: 109

Get value after a word from plsql string

I have employee table in plsql, I have employee id column and emp_email_body column in that, in emp_email_body column i have lengthy values like

'blaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahhblaaahh Item: http://google.com bbblahhhhhhhhh'

I want to get that url text after the Item: word (Item: word is there in every record and url is after that word)

need to use Regexp but not sure how.

Thanks in advance for any help.

Upvotes: 0

Views: 187

Answers (1)

Kaushik Nayak
Kaushik Nayak

Reputation: 31656

Assuming that you have a space after your URL, try something like

select regexp_substr(s,'Item:\s+([^ ]+)',1,1,null,1)
FROM t;

Upvotes: 1

Related Questions