<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_team_info_raw(soup, base_url, team_pattern, team, sport):
 """ Parses through html page to gather raw data about team :param soup: BeautifulSoup object containing html to be parsed :param base_url: Pre-formatted url that is formatted depending on sport :param team_pattern: Compiled regex pattern of team name/city :param team: Name of the team that is being searched for :param sport: Sport that is being searched for :return: List containing raw data of team """

    team_url = None
    team_name = None
    for link in soup.find_all('a'):
        if re.search(team_pattern, link.string):
            team_name = link.string
            team_url = base_url.replace('/teams/', link['href'])

    if team_url is not None and team_name is not None:
        team_soup = BeautifulSoup(requests.get(team_url).content, 'html.parser')
        team_info_raw = team_soup.find('div', id='meta').contents[3].get_text().split('\n')
        team_info_raw = [x.replace('\t', '') for x in team_info_raw]
        team_info_raw = [x.strip() for x in team_info_raw if x != '']
        team_info_raw[0] = team_name
        return team_info_raw
    else:
        raise errors.TeamNotFoundError(sport, team)