I am pretty new to using string operations in SQL(Redshift). I want to extract a part of a string from the strings of the following format:
I can have strings of the format:
http://bunnytalks.com/goingOn?name=Bunny&phone=2340
http://bunnytalks.com/goingOn?name=Bunny
http://bunnytalks.com/goingOn?name=Talks/whatson%goingOn%name%Bunny
http://bunnytalks.com/goingOn?name=Talks/whatson%goingOn%name%Bunny&phone=2340
The final output I need from any of the above strings when applying regex:
Bunny
From the above string examples, I can tell that I need a string between the last occurrence of a name
followed by either =
or %
and the end of the string or before &
I need a regex/ any string operations in SQL that can achieve the above operations as shown in examples. Thanks in advance.