factor out the name regexp