all static method
Returns a regex String matching with all the words from the keywords
.
Implementation
static String all({
required List<String> keywords,
bool searchWords = false,
}) {
String regex = r'(';
for (var keyword in keywords) {
if (searchWords) {
// The perfect word is in the string.
keyword = r'\b' + keyword + r'\b';
}
regex += '(?=.*$keyword)';
}
return regex + r'.*)';
}