getRegexKeyFromKey function

Future<String?> getRegexKeyFromKey(
  1. String key
)

Implementation

Future<String?> getRegexKeyFromKey(String key) async {
  String regexKey;
  var allRegex = await getRegexKeys();
  var index = allRegex.indexWhere((element) => element.contains(key));
  if (index > -1) {
    regexKey = allRegex[index];
    return regexKey;
  } else {
    return null;
  }
}