JSFiddle - React, Tailwind, and code Playground

HTML

Result: <textarea></textarea>

CSS

textarea {
    width: 120px;
    height: 80px;
}

JavaScript

var url = [
    "http://www.myurl.com/abcs/der/er/.../asdsad/hrllo1.shtml#header?query=whatever&....",
    "http://www.myurl.com/abcs/der/er/.../asdsad/hrllo2.shtml?query=whatever",
    "http://www.myurl.com/abcs/der/er/..../asdsad/hrllo3.shtml",
    "http://myurl.com/index3.html#query=twitter.com/search"
    ],
    i, left, index, page = [];
for (i = 0; i < url.length; i++) {
    left = url[i].split(/[#?]/g)[0];
    index = left.lastIndexOf('/') + 1;
    page.push(left.slice(index));
}

$('textarea').val(page.join('\n'));