also allow / and # in every position of placeholder name

This commit is contained in:
ralf 2023-04-11 17:11:56 +02:00
parent b55328b84f
commit ff6d1eb5df

View File

@ -32,10 +32,11 @@ export class IsEmail extends Pattern
* - "{{email}}"
* - "{{n_fn}} <{{email}}"
* - "{{#<custom-field-name>}}"
* - "{{info_contact/email}}" or "{{user/#<custom-field-name}}"
* - we do NOT check if the placeholder is implemented by addressbook or a valid custom-field name!
* - "test" or "{test}}" are NOT valid
*/
static EMAIL_PLACEHOLDER_PREG = new RegExp('^(.*{{#?[a-z0-9_]+}}.*|'+IsEmail.EMAIL_PREG.source.substr(1, IsEmail.EMAIL_PREG.source.length-2)+')$', 'i');
static EMAIL_PLACEHOLDER_PREG = new RegExp('^(.*{{[a-z0-9_/#]+}}.*|'+IsEmail.EMAIL_PREG.source.substr(1, IsEmail.EMAIL_PREG.source.length-2)+')$', 'i');
/**
*