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.
我想标记以下字符串。“我和马克的兄弟一起回家玩电子游戏。” 结果应该是这样的。
I went home with Mark ' s brother to , play a video game .
你能告诉我如何使用正则表达式。
如果你真的想要,,.并且'作为单独的标记,你可以这样拆分:
,
.
'
String str = "I went home with Mark's brother, to play a video game."; String[] tokens = str.split("(\\s|(?=[,.'])|(?<=[,.']))");