generateTextSearcherFromRegExp function
Creates the corresponding SMUTextSearcher from the given expression
.
The returned function will check if any passed strings have a match with expression
, returning true if at least one input matches.
Implementation
SMUTextSearcher generateTextSearcherFromRegExp(RegExp expression) =>
(input) => input
.map((e) => expression.hasMatch(e))
.reduce((value, element) => value || element);