Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Created May 13, 2020 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/363028078329b399b0ab5f39bb7b4929 to your computer and use it in GitHub Desktop.
Save McLarenCollege/363028078329b399b0ab5f39bb7b4929 to your computer and use it in GitHub Desktop.
void main() {
RegExp expression = RegExp(r'[cmf]an');
Iterable<RegExpMatch> matches = expression.allMatches(searchString);
matches.forEach((match) => print(match.group(0)));
}
String searchString = "Ana Bob Cpc aax bby ccz";
// How do we match 'Ana', 'Bob' and 'Cpc'?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment