我有一个像
"SimpleKey1: word1. SimpleKey2Word1 SimpleKey2Word2: word word word, word word. word word. CompoundKey3 / CompoundKey3: word word word, word. Key3: word. CompoundKey4Word1 CompoundKey4Word2 / CompoundKey4Word3 CompoundKey4Word4: word words, words word-word (word 18 word 100 ). CompoundKey5 / CompoundKey5: word word."
我需要解析该字符串以获得键/值映射,例如:
SimpleKey1: word1.
SimpleKey2Word1 SimpleKey2Word2: word word word, word word. word word.
CompoundKey3 / CompoundKey3: word word word, word.
CompoundKey4Word1 CompoundKey4Word2 / CompoundKey4Word3 CompoundKey4Word4: word words, words word-word (word 18 word 100 ).
CompoundKey5 / CompoundKey5: word word.
请注意,键可以包含斜杠字符 (/),值可以包含特殊字符。
我不知道应该使用什么正则表达式。
谢谢。