RegExp object to match and validate URL(s).
import URLRegExp from 'url-regexp';URLRegExp.validate('input string');URLRegExp.match() will return all valid URLs from the string.
URLRegExp.match('input string');URLRegExp.replace() will replace all url instances depending on the passed replacment string or function identical as String.prototype.replace().
let strWithUrls;
strWithUrls = 'John favorite website is http://twitter.com';
URLRegExp.replace(strWithUrls, 'twitter');
// John favorite website is twitterDownload using NPM:
npm install --save url-regexp