我有一个清单:
key1:this is an{example{of an example}I like} key2:this is another example key3: this is secondary{example{of an example}}
我需要分离键并按差异比较键的值,所以我想获得的结果是:
{
:key1 => 'this is an [example[of an example]I like]',
:key2 => 'this is another example',
:key3 => 'this is secondary[example[of an example]]'
}
Ruby 或 Regex 是否可以实现类似或类似的功能?