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.
getと"50[=]Test Item"を使用して Java で分割したいStringがあります。それを達成するための正しい正規表現は何ですか。String.split"50""Test Item"
"50[=]Test Item"
String.split
"50"
"Test Item"
どんな助けでも大歓迎です。
[正規表現の特殊文字であるため、分割中にエスケープする必要があります。[文字クラスを開始するため、エスケープする必要があります。エスケープする必要はありません]:
[
]
Arrays.toString("50[=]Test Item".split("\\[=]"));
あなたに与える:
[50, Test Item]