code: def concatenate_matches(a, b, text, name):
      
      match = Match(a.start, b.end, text[a.start:b.end], name)
      for k, v in a.matches.items():
          match.matches[k] = v
      for k, v in b.matches.items():
          match.matches[k] = v
      if a.name is not None:
          aa = copy(a)
          del aa[MATCHES]
          match.matches[a.name] = aa
      if b.name is not None:
          bb = copy(b)
          del bb[MATCHES]
          match.matches[b.name] = bb
      return match
docs: Concatenate matches a and b.
      All submatches will be copied to result.