How to write validation rules?

How to write validation rules?

Perl validations can be found here at this documentation page
/surveyengine-software-documentation/the-editing-phase/edit_page_screen/validation-recipies/