Hi fellow Sparxians,
I would like to have a Tagged Value that captures a valid email address.
I could do it with the the "Type=AddinBroadcast" but I do not want have the support issue of deploying an add-in.
I looked at the Type=Custom, with Mask and Template but this is only good for fixed length.
It reminded me of regular expression place holders, so I thought...
How about:
Type=Regex;
Pattern=validRegex;
ErrorMsg=An error message or prompt;
Then I could use the following for a valid email address:
validRegex =[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*;
So the whole thing for my email address would be:
Type=Regex;
Pattern=[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*;
ErrorMsg=Please enter a valid email address, which generally looks like '
[email protected]';
Sparx would have to parse this very carefully, i.e. don't get caught out by additional = or ; characters in the regex.
This could be used for many other types of text validation when creating tagged values.
Anyone else agree, disagree, suggestions for alternatives?