skip to Main Content

how can I modify this regular expression so that it distinguishes between latin and russian letters in links and emails – Reactjs

At the moment my program looks like this: let final = text; const divElement = document.createElement('div'); // eslint-disable-next-line max-len const linkRegExp = /b(((http(s)?://)([w-]{1,32}(.|:)[w-]{1,32}))|([w-]{1,32}(@)[w-]{1,32}(.)[w-]{1,32})|([w-]{1,32}(.)[A-Za-z]{1,32}))b/gi; function replacer(url) { if (url.match(/S+@S+.S+/ig)) { const email = document.createElement('a'); email.innerHTML = url; email.href = `mailto:${url}`; email.setAttribute('class',…

VIEW QUESTION
Back To Top
Search