escapeRegExp method

String escapeRegExp()

Return the HTML escaped version of a string

Implementation

String escapeRegExp() => this
    .split('')
    .map((e) => REGEXP_SPECIAL_CHARACTERS.hasMatch(e)
        ? r'\\'+e
        : e)
    .join();