Better regex matching