say I have a long URL
xyz = 'www.google.com/xyz?para1=value1¶2=value2¶3=value3....'
I am trying to get the 'para1' out of this long URL
So, I have
select TRIM(Leading '?' from Substring(xyz from '%#"?%=#"%' for '#'))
The answer I get for this particular statement is
para1=value1¶2=value2¶3=
How can I get just 'para1' using the select statement above (or any other similar method?)
I am using Greenplum (as mentioned in the topic heading)
Since you apparently have the regexp_
functions (I didn't think Greenplum supported them) use:
select (regexp_matches(
'www.google.com/xyz?para1=value1¶2=value2¶3=value3....',
'\?([^&]+)='
))[1];