Does n/email have a validation method for the addr...
# suitescript
c
Does n/email have a validation method for the address? Some sneaky csr put a period at the end of an address...
a
No, there is no email validation function or method (as far as I know) but this problem is older than the internet, you can find plenty of bullet proof methods online that solve this issue. You will need a combination of regex + length guards etc... As long as your solution/code ends up being RFC 5321-compliant then you are going to cover every single edge case.
c
Indeed. I was hoping not to have to go down the regex route. I'll test a few and see which ones are the most managable. Normally it's the cs using the wrong separator which we have a test for.
Ended up using the regex from https://emailregex.com/index.html
👍 1