src/html-amend.js
function replaceWith(input, regex, content) {
            // Sanity check
            verifyParameterIsDefined(input, 'input', 'replaceWith');
            verifyParameterIsDefined(regex, 'regex', 'replaceWith');

            return replaceAt(normalizeValue(input), normalizeRegExp(normalizeValue(regex)), normalizeValue(content));
        }
function replaceWith(input, regex, content) {
            // Sanity check
            verifyParameterIsDefined(input, 'input', 'replaceWith');
            verifyParameterIsDefined(regex, 'regex', 'replaceWith');

            return replaceAt(normalizeValue(input), normalizeRegExp(normalizeValue(regex)), normalizeValue(content));
        }
function replaceWith ( input , regex , content ) { // Sanity check verifyParameterIsDefined ( input , 'input' , 'replaceWith' ) ; verifyParameterIsDefined ( regex , 'regex' , 'replaceWith' ) ; return replaceAt ( normalizeValue ( input ) , normalizeRegExp ( normalizeValue ( regex ) ) , normalizeValue ( content ) ) ; }
Replaces content specified by a regular expression with specified content.

@param {String|Function} input the input to replace
@param {String|RegExp|Function} regEx the regular expression (or string) to replace within the input
@param {String|Function} [content] the content to replace
@return {String} a String which has the first occurrence of the regular expression within input replaced with the content
@throws {String} when input or regex are not defined
Replaces content specified by a regular expression with specified content .