比方说,我有文字的身体像这样,这是什么阵正则表达式
["What Color",["Red","Blue","Green","Yellow","Brown","White"]]
什么是匹配的颜色
我试试这个
while ($mystring =~ m,/"(.*?)"/|,|[/"(.*?)"|,|/],g);
print "Your Color is : [$1]\n";
正则表达式
有人可以帮我这个perl脚本应该打印
- Your Color is: Red - Your Color is: Blue - Your Color is: Green - Your Color is: Yellow - Your Color is: Brown - Your Color is: White
正则表达式和数组不走在一起。 – BoltClock
为什么你不会使用JSON http://search.cpan.org/~makamaka/JSON-2.53/lib/JSON.pm? – hsz