escapeRegExp function

String escapeRegExp(
  1. String string
)

Implementation

String escapeRegExp(String string) {
  return string.replaceAll(RegExp(r'[.*+?^${}()|[\]\\]'), '\\\$&');
}