Skip to content

Instantly share code, notes, and snippets.

Created Dec 16, 2019
What would you like to do?
void main() {
RegExp exp = new RegExp(r"[a-zA-Z]+");
String str = "Parse my string";
print('${getByToken(str, '[a-zA-Z]+')}');
List<String> getByToken(var str , var token){
RegExp exp = new RegExp("${token}");
Iterable<RegExpMatch> matches = exp.allMatches(str);
// print(matches.length);
var l =>;
// print(l.length);
return l;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment