parse static method

YoutubeUserUrl? parse(
  1. String url
)

Implementation

static YoutubeUserUrl? parse(String url) {
  var matches = RegExp(
          r'(?:https?:)?\/\/(?:[A-z]+\.)?youtube.com\/user\/(?<username>[A-z0-9]+)\/?')
      .allMatches(url);
  var username = matches.getValue("username");
  if (username == null) return null;
  return YoutubeUserUrl._(username);
}