lib/diacritics.js
function replaceInsensitive(chr, dbl) {

		var lower = chr.toLowerCase(),
		    upper = chr.toUpperCase(),
		    result,
		    dbl_result;

		if (lower == upper) {
			return chr;
		}

		result = '[' + lower + upper;

		result += (baseDiacriticsMap[lower]||'');
		result += (baseDiacriticsMap[upper]||'');

		result += ']';

		if (dbl) {
			lower = dbl.toLowerCase();
			upper = dbl.toUpperCase();

			dbl_result = baseDiacriticsMap[lower] || '';
			dbl_result += baseDiacriticsMap[upper] || '';

			if (dbl_result) {
				// Make the previous group optional,
				// but do require one of these groups then
				result = '?(?:' + result + '|[' + dbl_result + '])';
			}
		}

		return result;
	}
function replaceInsensitive(chr, dbl) {

		var lower = chr.toLowerCase(),
		    upper = chr.toUpperCase(),
		    result,
		    dbl_result;

		if (lower == upper) {
			return chr;
		}

		result = '[' + lower + upper;

		result += (baseDiacriticsMap[lower]||'');
		result += (baseDiacriticsMap[upper]||'');

		result += ']';

		if (dbl) {
			lower = dbl.toLowerCase();
			upper = dbl.toUpperCase();

			dbl_result = baseDiacriticsMap[lower] || '';
			dbl_result += baseDiacriticsMap[upper] || '';

			if (dbl_result) {
				// Make the previous group optional,
				// but do require one of these groups then
				result = '?(?:' + result + '|[' + dbl_result + '])';
			}
		}

		return result;
	}
function replaceInsensitive ( chr , dbl ) { var lower = chr . toLowerCase ( ) , upper = chr . toUpperCase ( ) , result , dbl_result ; if ( lower == upper ) { return chr ; } result = '[' + lower + upper ; result += ( baseDiacriticsMap [ lower ] || '' ) ; result += ( baseDiacriticsMap [ upper ] || '' ) ; result += ']' ; if ( dbl ) { lower = dbl . toLowerCase ( ) ; upper = dbl . toUpperCase ( ) ; dbl_result = baseDiacriticsMap [ lower ] || '' ; dbl_result += baseDiacriticsMap [ upper ] || '' ; if ( dbl_result ) { // Make the previous group optional, // but do require one of these groups then result = '?(?:' + result + '|[' + dbl_result + '])' ; } } return result ; }
Replace the given character without caring about the case

@author   Jelle De Loecker   <jelle@develry.be>
@since    0.0.1
@version  0.6.4
Replace the given character without caring about the case