code: def _get_replacement_token(msg):
      
      return (
          None
          if not re.search(r"\*\[[\w|\W]+\]\*", msg)
          else re.search(r"\*\[[\w|\W]+\]\*", msg).group()[2:-2]
      )
docs: Extract replacement token from exception message.