import re


def ExtractTagFromLine(line):
  """Extract a tag from a line of HTML, C++, JS or JSON."""
  # HTML-style
  m = re.search('i18n-content=[\'"]([^\'"]*)[\'"]', line)
  if m: return m.group(1)
  # C++/Javascript style
  m = re.search('/\*i18n-content\*/[\'"]([^\`"]*)[\'"]', line)
  if m: return m.group(1)
  # Manifest style
  m = re.search('__MSG_(.*)__', line)
  if m: return m.group(1)
  return None