in java regex,use [^x]
to matching "not" with one char.
i want to know,how to matching more chars not?
i using [^789]
,it's not right.
String text="aa(123)bb(456)cc(789)dd(78)";
text=text.replaceAll("\\([^789].*?\\)","");
System.out.println(text);
i want get result is:
aabbcc(789)dd
how to fix my regex pattern?
thanks a lot :)