charmi
charmi

Reputation: 307

pattern matching in postgresql

I need to substring "test" from my variable "5.myname (test)" in postgresql I am able to extract number[i.e 5] and text [i.e myname] from above string but unable to extract test. can anyone please suggest pattern to extract test from above string.

Upvotes: 0

Views: 42

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 247235

SELECT substring('5.myname (test)' from '\((.*)\)');

Upvotes: 1

Related Questions