Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用正则表达式从变量中提取值。输出采用以下格式:
[["\"XXX.YYY\""]]
所以,我使用 flatten & 它给了我这个输出:
["\"XXX.YYY\""]
我怎样才能只XXX.YYY从中提取?
XXX.YYY
尝试:
a = [["\"XXX.YYY\""]] puts a.flatten[0].gsub('"','')