dart regex example
Example 1: dart regex
RegExp exp = new RegExp(r"(\w+)");
String str = "Parse my string";
Iterable<RegExpMatch> matches = exp.allMatches(str);
Example 2: dart regex,regex dart
var numbers = RegExp(r'\d+');
var allCharacters = 'llamas live fifteen to twenty years';
var someDigits = 'llamas live 15 to 20 years';
assert(!allCharacters.contains(numbers));
assert(someDigits.contains(numbers));
var exedOut = someDigits.replaceAll(numbers, 'XX');
assert(exedOut == 'llamas live XX to XX years');