• [^] # Re: javascript

    Posté par (site web personnel) . En réponse au journal Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..). Évalué à 2.

    allez, histoire d'accumuler les retours et les regexp :


    // Simple regular expression to match http / https / ftp-style URLs.
    var parsedURL = /^(\w+)\:\/\/([^\/]+)\/(.*)$/.exec(url);
    if (parsedURL) {
    var [, protocol, fullhost, fullpath] = parsedURL;
    [...]
    }


    Si ça c'est pas sympa comme code !