Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从Ruby中的一个长字符串中提取字符串_Ruby - Fatal编程技术网

从Ruby中的一个长字符串中提取字符串

从Ruby中的一个长字符串中提取字符串,ruby,Ruby,我有一个很长的字符串,我想以列表的形式从中提取特定的字符串 字符串: [#<User id: 1, login: "test", hash ... ] [# string.scan(/login: "(.*?)",/)

我有一个很长的字符串,我想以列表的形式从中提取特定的字符串

字符串:

[#<User id: 1, login: "test", hash ... ] 
[#
string.scan(/login: "(.*?)",/)