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|(?=[,.'])|(?<=[,.']))");