Broke the regular expressions out. Added some tests.  Return on undefined values.