Retourner au contenu associé (journal : Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..))
Posté par CrEv (site web personnel) le 20 janvier 2009 à 16:28. En réponse au journal Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..). Évalué à 2.
// Simple regular expression to match http / https / ftp-style URLs. var parsedURL = /^(\w+)\:\/\/([^\/]+)\/(.*)$/.exec(url); if (parsedURL) { var [, protocol, fullhost, fullpath] = parsedURL; [...] }
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: javascript
Posté par CrEv (site web personnel) . En réponse au journal Perl, Javouille, Lisaac|(Ruby|SmallTalk|etc..). Évalué à 2.
// 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 !