in user event script how do you sanitize an email ...
# suitescript
a
in user event script how do you sanitize an email address?
b
test against a regular expression
netsuite uses the following pattern clientside, so its probably what you want serverside
Copy code
/^[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]+(?:\.[-a-zA-Z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[a-zA-Z0-9]+(?:-+[a-zA-Z0-9]+)*\.)+(?:xn--[-a-zA-Z0-9]+|[a-zA-Z]{2,16})$/i
dont ask me how this particular regular expression works
a
🙂
thanks
p
That looks like 4 days worth of Perl development 😉
b
its the kind of thing you go to stack overflow for
there are multiple versions of this regular expression, mostly because the more correct one looks even more ridiculous