Mudits
Mudits

Reputation: 1643

Regex for matching parentheses

I have string : select * from workspace populate $intname(Column 5) with column_1 as lookup [(Office Military,OM)]

In which I want to match $intname(Column 5)

The regex I have written is : \$intname\(.+\)

which matches $intname(Column 5) with column_1 as lookup [(Office Military,OM)

How do I achieve this?

Upvotes: 1

Views: 72

Answers (1)

Toto
Toto

Reputation: 91518

Make the regex non greedy:

\$intname\(.+?\)

or

\$intname\([^)]+\)

Upvotes: 2

Related Questions