I have a regular expression that matches words with .
in between them as potential urls but not those with @
in front of them as they are assumed to be emails.
This is the regex that I have:
(?:\@(https?:\/\/)?(\w+(\-*\w+)*\.)[a-zA-Z\.]+[\w+\/?\#?\??\=\%\&\-]+.*?)*\K(https?:\/\/)?(\w+(\-*\w+)*\.)[a-zA-Z\.]+[\w+\/?\#?\??\=\%\&\-]+
This is not working for the last occurrence of email perfectly.
For example, for the string
twitter.com facebook.com kamur@test.com ksou@uni.edu vimal@gsomething.com balaji@sweets.com john wayne <johnwayne@dc.com> 20,000.00
I expect the matches to be twitter.com
and facebook.com
.
But it also matches dc.com
.