如果我使用以下代码:
let original = "http://www.spur-g-shop.de/index.php?action=buy_now&BUYproducts_id=56&
http://associations.beauvais.fr/en-un-clic/index.php?option=com_fabrik&view=list&listid=4&Itemid=520&asso_annuaireweb___id_soustheme_raw=40&sous_theme___ID_Theme=SPORTS&resetfilters=1
http://laptopbank.net/product_detail.php?detail_id=B075FLBJV7
https://www.music-scores.com/sheet-music/freeinstrument.php?instrument=Alto%20Sax
http://www.traxjo.com/index.php?PageType=2&MenuID=1&Sub=1&Lang=1
http://www.bizfocus.co.kr/admin/bbs/down.php?code=data&idx=8928&no=1
http://www.vivitekthailand.com/en/Product_view.php?ProductId=115&CategoryId=7
http://www.fsrm.ch/doc/c474.php?lang=e&id=474
https://catalog.prm-catalog.com/index.php?lang=tw&ID=18&CatalogID=2839
https://astacology.org/AboutCrayfish.asp?uid=Guest"
当然假设每个新行都是 \n
我运行这段代码:
let dorks = original.split('/').pop().split('?')[0];
console.log(dorks)
它只返回:
index.php(对于第一个网址)
我怎样才能让它一起返回每一行?
MM们
拉风的咖菲猫
犯罪嫌疑人X
大话西游666
相关分类