import re


def pay_interval(payment_phrase: str) -> str:
    """Find first match of pay interval key word

    payment_phrase: text containg pay interval information:

    raises: ValueError if cannot find a payment interval insde payment_phrase
    """
    interval_exp = '(?P<interval>hour|day|week|biweek|month|year|annual)'
    match = re.search(interval_exp, payment_phrase.lower())
    if match:
        interval = match.group('interval')
    else:
        print(f'Could not find payment interval in {payment_phrase}')
        raise ValueError

    return interval