fork 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 allowedChars = "";
  11. for (String ch : allowedChar)
  12. if (ch.matches("^[^\\x00-\\x7F]$"))
  13. allowedChars += ch;
  14. String Modified_remark = final_remark.replaceAll("[^\\x00-\\x7F" + allowedChars + "]", "");
  15. System.out.print(Modified_remark);
  16. }
  17. }
  18.  
Success #stdin #stdout 0.04s 320576KB
stdin
Standard input is empty
stdout
abcÅμ