Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Utils {
static bool isNullOrEmpty(String s) {
return s == null || s == '';
}
static String stripTags(String s) {
return s.replaceAll(new RegExp('<[^>]*>'), '');
}
static Set<String> urlMatchs(String s) {
RegExp exp = new RegExp(
r"https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)");
return exp.allMatches(s).map((m) => m.group(0)).toSet();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.