Check that regex matching was successful