function escape(str) {
    if (typeof str !== 'string' || str.length === 0)
        return '';
    return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
}
/**
 * Escape regular expression special characters.
 *
 * @param str
 * @returns {string|void | string | never} a string of Regular
 */
Escape regular expression special characters.
@param str
@returns {string|void | string | never} a string of Regular
Escape regular expression special characters . @param str @returns { string|void | string | never } a string of Regular
function escape(str) {
    if (typeof str !== 'string' || str.length === 0)
        return '';
    return str.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
}
function escape ( str ) { if ( typeof str !== 'string' || str . length === 0 ) return '' ; return str . replace ( / [-/\\^$*+?.()|[\]{}] / g , '\\$&' ) ; }
Escape regular expression special characters.
Escape regular expression special characters .