def amountPattern(name):
    """Returns a string regex pattern to capture a dollar amount.

    It includes two capture groups for use with getBeancountAmount.
    """
    return (
        '\(?'
         '(?P<' + name + 'sign>[-–] ?)?' # Handle two types of negative signs
         '\$(?P<' + name + '>[0-9,]+\.\d+)'
         '\)?'
    )