fork(1) download
  1. import java.io.*;
  2. import java.util.regex.*;
  3.  
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String final_remark = "abcÀÁÂÅμ";
  9. String[] allowedChar = {"Å", "μ"};
  10. String Modified_remark = final_remark.replaceAll(
  11. "[^\\x00-\\x7F" + String.join("", allowedChar) + "]", "");
  12. System.out.print(Modified_remark);
  13. }
  14. }
  15.  
Success #stdin #stdout 0.05s 320576KB
stdin
Standard input is empty
stdout
abcÅμ