parse static method

AngelJobUrl? parse(
  1. String url
)

Implementation

static AngelJobUrl? parse(String url) {
  var matches = RegExp(
          r'(?:https?:)?\/\/angel\.co\/company\/(?<company>[A-z0-9_-]+)\/jobs\/(?<job_permalink>(?<job_id>[0-9]+)-(?<job_slug>[A-z0-9-]+))')
      .allMatches(url);
  var company = matches.getValue("company");
  var jobId = matches.getValue("job_id");
  var jobPermalink = matches.getValue("job_permalink");
  var jobSlug = matches.getValue("job_slug");
  if (company == null) return null;
  if (jobId == null) return null;
  return AngelJobUrl._(
    company: company,
    jobId: jobId,
    jobPermalink: jobPermalink,
    jobSlug: jobSlug,
  );
}