JavaScript: Email Validation (pt. 2)

Tech: JavaScript

Challenge: following up on validating emails in forms, I like this regex. Lengthy, but working well within React application.

isEmailValid = (email) => {

const reg = /^[\w!#$%&'*+\-/=?\^_`{|}~]+(\.[\w!#$%&'*+\-/=?\^_`{|}~]+)*@((([\-\w]+\.)+[a-zA-Z]{2,4})|(([0-9]{1,3}\.){3}[0-9]{1,3}))$/

return reg.test(email.trim())

}

 

Takeaway: how could I incorporate pt.1 into my React app?