Here's a nice example where a regex constraint on the resourceURI parameter would work nicely:
filen= getParam( 'resourceURI', 'file:/home/jbf/tmp/voyager-1-pws-sa/data/2020/vg1pws_lr_20200101_v5.30.cdf', 'The CDF file' )
if not filen.endswith('.cdf'):
raise Exception('filename should end in .cdf')
The check for endswith .cdf would not be necessary. The scientist would get a consistent and clear error message (make sure this is the case, don't use regex in the error message), and a file browser on getParam could limit the files displayed to those which match.
Also consider a constraint on resourceURI like "fileExtension" so that those not familiar with regular expressions can use the feature.
This is verified. The regex constraint works for any parameter.
I've also added a glob constraint, since files are ubiquitous, so
{'glob':'*.cdf' }can be used.