I have right regex to find urls in text, but one thing i can't solve. If url ends with DOT - this dot matches as part of url.
This is my pattern:
/(^|[\?\s])(www\.[^\? ]+\/[^\/ ]*\?[^\? ]+|www\.[^\? ]+)/g
For sample, text is 'The url is www.domain.com. Second is wiki.org.'
Urls last dot is not part of url, but regex replace it too.