terminals now defined using regexes