from typing import List
import re


def extract_ints(line: str, negative: bool = False) -> List[int]:
    """ Trawl the input line for any integers and return them as a list.

    This will extract ints, including negatives if requested that are not
    necessarily comma separated.
    """
    regex = r'(-?\d+)' if negative else r'(\d+)'
    return list(map(int, re.findall(regex, line)))