getNotesRegex function

Pattern getNotesRegex(
  1. List<String> noteKeywords
)

Implementation

Pattern getNotesRegex(List<String> noteKeywords) {
  if (noteKeywords.isEmpty) {
    return RegExp(r'(?!.*)');
  }
  final noteKeywordsSelection = noteKeywords.join('|');
  return RegExp('^[\\s|*]*($noteKeywordsSelection)[:\\s]+(.*)',
      caseSensitive: false);
}