Fixed regex and updated test to check valid profile names work.