【发布时间】:2013-11-13 23:50:19
【问题描述】:
我的问题与Split string including regular expression match 相同,但针对的是 Scala。不幸的是,JavaScript 解决方案在 Scala 中不起作用。
我正在解析一些文本。假设我有一些字符串:
"hello wold <1> this is some random text <3> foo <12>"
我想获得以下 Seq:"hello world" :: "<1>" :: "this is some random text" :: "<3>" :: "foo" :: "<12>"。
请注意,每当遇到 序列时,我都会拆分字符串。
【问题讨论】: