int regExIndexOf1(String pattern, String source) { var rgx = RegExp(pattern); var first = rgx.firstMatch(source); if (first == null) // return -1; return first.start; }