Programatic Accent Reduction in JavaScript (aka text normalization or unaccenting)
/** * Creates a RegExp that matches the words in the search string. * Case and accent insensitive. */ function make_pattern(search_string) { // escape meta characters search_string = search_string.replace(/([|()[{.+*?^$\\])/g,”\\$1″); // split into words var words = search_string.split(/\s+/); // sort by length var length_comp = function (a,b) { return b.length – a.length; }; words.sort(length_comp); // replace … Read more