I want to store "~ s/\n|\s+|.*?=|;//g;"
in a string variable.
Can anyone help me in this. Thanks in advance.
I want to store "~ s/\n|\s+|.*?=|;//g;"
in a string variable.
Can anyone help me in this. Thanks in advance.
You have to replace \
by \\
in a Java String literal.
See https://docs.oracle.com/javase/tutorial/essential/regex/literals.html (at the bottom).
That is
String regExp = "~ s/\\n|\s+|.*?=|;//g;";
should work.