Reputation: 18597
I have this text -
[Event "F/S Return Match"]
This is my regex -
\[.*"
The match is -
[Event "F/S Return Match"
I was expecting -
[Event "
Why is the first quote being ignored?
Upvotes: 4
Views: 65
Reputation: 785058
Make it non-greedy regex:
\[.*?"
Or better use negation:
\[[^"]*"
Upvotes: 4