Validation pattern for strings
A Validation Pattern can be set in the App Builder to ensure the user is inputting a parameter setting in the proper format. This will be present for input parameters that are strings.
Validation patterns are regular expressions, as described here.
^
matches as the beginning of the string, $
matches at the end of the string. Using both will ensure the parameter value entered matches the entire string and not part of the string. +
matches the previous pattern one or more times, *
matches the previous pattern 0 or more times.
Here are some common examples:
Alphanumeric characters with underscores or dashes, but no spaces:
^[a-zA-Z0-9]+[_]
[-]
[a-zA-Z0-9]*$
Any file name with a fasta extension:
^\S+.fn?a(sta)?(.gz)?$
Any file name with a GTF extension:
^\S+.gtf(.gz)?$
A csv, tsv, or txt file:
^\S+.(csv|tsv|txt)$