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.
我想存储"~ s/\n|\s+|.*?=|;//g;"在一个字符串变量中。
"~ s/\n|\s+|.*?=|;//g;"
任何人都可以在这方面帮助我。提前致谢。
您必须在 Java 字符串文字中替换\为。\\请参阅https://docs.oracle.com/javase/tutorial/essential/regex/literals.html(在底部)。
\
\\
那是
String regExp = "~ s/\\n|\s+|.*?=|;//g;";
应该管用。