#!/usr/bin/env js print("URLを入力して下さい"); var url = readline(); if (url.match(/\s*\S+?\/\S+?\/([^/]+\S+)\s*/)) { path = RegExp.$1; } print(path);