Java examples for java.util.regex:Match Unicode
remove Accents using regex
//package com.java2s; import java.text.Normalizer; import java.text.Normalizer.Form; public class Main { public static void main(String[] argv) { String text = "java2s.com"; System.out.println(removeAccents(text)); }//from ww w . j ava 2 s. co m public static String removeAccents(String text) { return text == null ? null : Normalizer.normalize(text, Form.NFD) .replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); } }