Reapply "fix regex and assign random user ids" from Xavier