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.
文字コードがゼロでないすべての文字列に一致する正規表現をJavaでどのように記述しますか?
私はもう試した:
Pattern.compile ("[^\0]");
と
Pattern.compile ("[^\u0000]");
ありがとう。
最初の正規表現はほぼ正しいですが、一致しない単一の文字にのみ一致し\0ます。次のように変更してみてください。
\0
Pattern.compile ("[^\0]+");
これは、ではない1つ以上の(+)文字と一致する必要があり\0ます。
+