convenience method for regex validation