Better regex and new tests