Regex Injection

regex-validation.py
@app.route('/share/<url>')
def share(link):
  """Return the meta-data for a web-link shared by a user."""

  # Validate the URL has a protocol using a regular expression.
  link = link if re.match("^[a-z]+://.*", link) else f"https://{link}"

  # Go grab the meta-data.
  return OpenGraph(url=link).to_json()