I want to find the domain name from the given string.
Lorem www.example.in ipsum # web developer dolor sit amet, consectetur adipiscing elit. Donec suraj@mishra.com , therefore, sem eros, et volutpat google.com lacus dignissim ac. Pellentesque ac nisl et erat porta feugiat. + 91-141-2561894 Vestibulum #web_designing sodales semper stackoverflow.com
what i tried
(www.)?[^@]\w+\.+\w{2,3}
return it to me 5 matches
www.exa
mple.in
mishra.com
google.com
stackoverflow.com
where I need only 3 bold matches.
Can you guys help me find out what I'm doing wrong?
Here is the RegEx101 Test
console.log("Lorem www.example.in ipsum #web-developer dolor sit amet, consectetur adipiscing elit. Donec suraj@mishra.com consequat sem eros, et volutpat google.com lacus dignissim ac. Pellentesque ac nisl et erat porta feugiat. +91-141-2561894 Vestibulum #web_designing sodales semper stackoverflow.com".match(/(www.)?[^@]\w+\.+\w{2,3}/g))
Run codeHide result