faster regex validation