parse static method

TelegramProfileUrl? parse(
  1. String url
)

Implementation

static TelegramProfileUrl? parse(String url) {
  // cSpell: ignore elegram
  var matches = RegExp(
          r'(?:https?:)?\/\/(?:t(?:elegram)?\.me|telegram\.org)\/(?<username>[a-z0-9\_]{5,32})\/?')
      .allMatches(url);
  var username = matches.getValue("username");
  if (username == null) return null;
  return TelegramProfileUrl._(username);
}