Simplify and update regexp to accept periods

@JnBrymn, I'm going to merge this since it's your suggestion anyway :)