parse static method
Implementation
static MediumUserUrl? parse(String url) {
var matches = RegExp(r'(?:https?:)?\/\/medium\.com\/@(?<username>[A-z0-9]+)(?:\?.*)?').allMatches(url);
var _userName = matches.getValue("username");
if (_userName != null) {
return MediumUserUrl._(null, _userName);
} else {
matches = RegExp(r'(?:https?:)?\/\/medium\.com\/u\/(?<user_id>[A-z0-9]+)(?:\?.*)').allMatches(url);
var _id = matches.getValue("user_id");
if (_id != null) return MediumUserUrl._(_id, null);
}
}