Changed regexp to better match with made up rules.
Added simple unittest