for matching root@localhost or similar. expression taken from emailregex.com for html5.
Signed-off-by: Oguz Bektas <o.bek...@proxmox.com> --- src/PVE/JSONSchema.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 36fa994..b5f9621 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -356,8 +356,8 @@ register_format('email', \&pve_verify_email); sub pve_verify_email { my ($email, $noerr) = @_; - # we use same regex as in Utils.js - if ($email !~ /^(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,63}$/) { + # html5 email regex + if ($email !~ /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/) { return undef if $noerr; die "value does not look like a valid email address\n"; } -- 2.11.0 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel