开发者

Ruby regex: extract text between quotes

What is the best way to get quoted words 开发者_开发技巧/ phrases out of the text?

This my attempt does not work properly:

text.scan(/\"([^"]+)/)


I think you want:

text.scan(/"([^"]*)"/)

It works in Rubular.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜