!TIL about http://www.regular-expressions.info/ which will either simplify my life immensely, or complicate it horribly.