createHighlightedTextsWithContains = function(oItemDomRef, sInputValue) {
		// If escape function is not defined
		if (!RegExp.escape) {
			RegExp.escape = function (s) {
				return s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
			};
		}
		var sText = oItemDomRef ? oItemDomRef.textContent : "",
			sFormattedText = "",
			escapedTerm = RegExp.escape(sInputValue),
			pattern  = new RegExp(escapedTerm, "gi"),
			isMatch = function(sText){
				return sText.match(new RegExp(pattern, "i"));
			};
			if (!isMatch(sText)) {
				return encodeXML(sText);
			} else {
				sFormattedText = sText.replace(pattern, function (match) {
					return '<span class="sapMInputHighlight">' + encodeXML(match) + '</span>';
				});
			}

		return sFormattedText;
	}
Creates highlighted text.

@private
@param {sap.m.Label} oItemDomRef Label within the input.
@param {string} sInputValue Text to highlight
@returns {string} sFormattedText Created text.