Reputation:
I want to match on the contents of some code between the strings var
and );
I'm currently using:
var([^)]+)\);
And this matches, except for when another closing bracket appears elsewhere in the text. So,
var (this does match);
var (this) doesn't match but should);
Regex example here
Upvotes: 0
Views: 20
Reputation: 9988
You could use simply this one if I understood fine what you want to match:
/var(.*);/
Upvotes: 1