title: Converting regex python to javascript
body: <p>I am very new to Regex, and I searched a long time for the equivilants in javascript, I would love it is somebody responded with a detailed explanation of the regex in javascript, converted from python.</p>
  
  <pre><code>import re
  
  regex = r"""
      ^(
        (?P&lt;ShowNameA&gt;.*[^ (_.]) # Show name
          [ (_.]+
          ( # Year with possible Season and Episode
            (?P&lt;ShowYearA&gt;\d{4})
            ([ (_.]+S(?P&lt;SeasonA&gt;\d{1,2})E(?P&lt;EpisodeA&gt;\d{1,2}))?
          | # Season and Episode only
            (?&lt;!\d{4}[ (_.])
            S(?P&lt;SeasonB&gt;\d{1,2})E(?P&lt;EpisodeB&gt;\d{1,2})
          | # Alternate format for episode
            (?P&lt;EpisodeC&gt;\d{3})
          )
      |
        # Show name with no other information
        (?P&lt;ShowNameB&gt;.+)
      )
      """
  
  test_str = ("archer.2009.S04E13\n"
      "space 1999 1975\n"
      "Space: 1999 (1975)\n"
      "Space.1999.1975.S01E01\n"
      "space 1999.(1975)\n"
      "The.4400.204.mkv\n"
      "space 1999 (1975)\n"
      "v.2009.S01E13.the.title.avi\n"
      "Teen.wolf.S04E12.HDTV.x264\n"
      "Se7en\n"
      "Se7en.(1995).avi\n"
      "How to train your dragon 2\n"
      "10,000BC (2010)")
  
  matches = re.finditer(regex, test_str, re.MULTILINE | re.VERBOSE)
  
  for matchNum, match in enumerate(matches):
      matchNum = matchNum + 1
  
      print ("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum = matchNum, start = match.start(), end = match.end(), match = match.group()))
  
      for groupNum in range(0, len(match.groups())):
          groupNum = groupNum + 1
  
          print ("Group {groupNum} found at {start}-{end}: {group}".format(groupNum = groupNum, start = match.start(groupNum), end = match.end(groupNum), group = match.group(groupNum)))
  </code></pre>
  
  <p><a href="https://regex101.com/r/mR6oD4/1" rel="nofollow noreferrer">Regex101</a></p>