refactor regex in Resolver