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.
我有以下形式的维基百科标记字符串 -
String wikiPediaMarkupString = "==Early life== === GOD === ==== GReat ====";
我需要编写一个正则表达式,以便我只得到字符串 -: Early Life , GOD 和 GREat 作为输出,而不是等号之间的空格,我真的很困惑如何为这个问题制定正则表达式。请帮助
试试split(" *=[= ]*")。这会将您的字符串拆分为分隔符之间的部分,其中正则表达式将分隔符定义为=包含至少一个空格和符号的序列=(正则表达式查找零个或多个空格,后跟=,后跟任意数量的空格或=) .
split(" *=[= ]*")
=