extractHrefValues static method

List<String> extractHrefValues(
  1. String input
)

Implementation

static List<String> extractHrefValues(String input) {
  RegExp regex = RegExp('<a [^>]*href=[\'"]([^\'"]+)[\'"][^>]*>',
      multiLine: true, caseSensitive: false);
  Iterable<Match> matches = regex.allMatches(input);
  return matches.map((match) => match.group(1)!).toList();
}