Change regex fromName method to have 'hasAnchor' parameter