Reputation: 13927
Let's say I have a string:
var n = 10
I'd like a regex which matches the following portion:
var n
I've tried:
var(.*?)=
But that only matches:
n
Upvotes: 1
Views: 51
Reputation: 19423
Why not wrap the whole thing with parentheses like this:
(var.*?)=
Upvotes: 3