Is there a less brittle way of doing this than with a regular expression (assume not given it's Devise...)?