Here you can find the source of normalizeSearchString(String src)
public static String normalizeSearchString(String src)
//package com.java2s; //License from project: Open Source License import java.text.Normalizer; import java.util.regex.Pattern; public class Main { public static String normalizeSearchString(String src) { return unaccent(src.toLowerCase().replace("-", " ")); }/*from w w w . j a v a2s. com*/ public static String unaccent(final String src) { final String temp = Normalizer.normalize(src, Normalizer.Form.NFKD); final Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); return pattern.matcher(temp).replaceAll(""); } public static String normalize(final String src) { return Normalizer.normalize(src, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "").replaceAll("[\\s/]", "_"); } }