Reputation: 6815
What is the best way to get quoted words / phrases out of the text?
This my attempt does not work properly:
text.scan(/\"([^"]+)/)
Upvotes: 13
Views: 19924
Reputation: 138982
I think you want:
text.scan(/"([^"]*)"/)
It works in Rubular.
Upvotes: 41