Web Form Requirements
ILLiad's web pages use something called Regular Expression Language to restrict what type of patterns or characters can be submitted in each field. These are listed in the Customization Manager in a table called WebValidation.
Writing a regular expression (regex for short) can be tricky, so we've put together some popular examples.
Email Requirement Examples:
^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*@(library)+\edu$
This will validate first.last@library.edu, with caps and numbers
^[A-Za-z0-9-]*@(library)+\edu$
This will validate caps and numbers before @library.edu
^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*@(library|lib)+\.edu$
This will validate only lowercase and numbers, with an option of what occurs after the @ symbol,but before the .edu
^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*@(usgs|conservation.ca)+\.gov$
This will let there be multiple, specific end entries after the @ symbol
^[a-zA-Z0-9._%+-]*@(dmu.edu|DMU.edu|DMU.EDU)$
This will be any single value before the @ symbol, with numbers and caps, with potential caps after the @ symbol
([-+.]\w+)*@(?:roswellpark|gogstats|CBioLabs.org).org
This will only allow emails from roswellpark.org, gogstats.org, or CBioLabs.org
([-+.]\w+)*@(?:aurora).edu
This only allows emails from @aurora.edu
Dropdown Restriction Examples:
^(?!(Choose a Location)).*$
Prevent new web users from selecting the "Choose a Location" line for NVTGC.
^(?!(Choose a Status)).*$
Prevent new web users from selecting the "Choose a Status" line.
Character Restriction Examples:
^[0-9]+$
This will only allow a string to contain numbers.
Date Restriction Examples:
^(?:([0-9]{2})[\/ ]?)?([0-9]{2})[\/ ]?([0-9]{4})$
This only allows DD/MM/YYYY
Atlas documentation about Web Validation
Regex101: a popular regex tester tool
Regex101 visualizer: a visual illustration
RegexExplained: a guide to help explain what a regular expression is saying in (mostly) plain English
Comments
Please sign in to leave a comment.