Nodejs URL Parse parseURL()

Here you can find the source of parseURL()

Method Source Code

String.prototype.parseURL = function() {
  return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=@]+/g, function(url) {
    return url.link(url);
  });/*from w w w.j av a  2  s .  c  om*/
};

Related

  1. parseURL()
    String.prototype.parseURL = function() {
      return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/g, function(url) {
        return url.link(url);
      });
    };
    
  2. parseURL()
    String.prototype.parseURL = function() {
      return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=]+/g, function(url) {
        return url.link(url);
      });
    };
    
  3. parseURL()
    String.prototype.parseURL = function() {
      return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&~\?\/.=]+/g, function(url) {
        return url.link(url);
      });
    };
    String.prototype.parseUsername = function() {
      return this.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) {
        var username = u.replace("@","")
        return u.link("http://twitter.com/"+username);
    ...
    
  4. parseURL()
    String.prototype.parseURL = function() {
      return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(url) {
        return url.link(url);
      });
    };