Web Studio is here! An enhanced experience to make it easier to create, preview, and collaborate on your website contentLearn More
As the demand for customizable content structures grows, so does the need for robust validation mechanisms. Traditional validation methods often fall short when it comes to handling complex data patterns or specific formatting requirements. Here, regular expressions emerge as the silver bullet, offering unparalleled versatility in defining validation rules.
By allowing users to define their own regular expressions, Agility CMS opens the door to a myriad of validation possibilities. Whether it's validating email addresses, phone numbers, URLs, or custom data formats, the flexibility of regular expressions knows no bounds. Moreover, the ability to test and refine expressions within the CMS interface streamlines the validation process, empowering users of all skill levels to craft precise validation rules tailored to their unique needs.
If you are not familiar with regular expressions, here are a few resources to get you started:
To use regex in field validation, navigate to your content model, click the "Advanced" tab, and scroll down until you see this:
Add your regex pattern as well as a custom validation message, and you're good to go! That field will now only accept values that match your regex.