【发布时间】:2019-06-08 20:33:22
【问题描述】:
我有一个像这样 (www.google.com/3ijadk382932) 的数组中来自不同服务器的链接列表,我需要进行搜索,包括 www.google.com/xxxxxxxxx,而在栏后也没有什么字符,并在数组中获取她的位置他们的 ani表单在javascript中做到这一点?
谢谢
let links = ["https://hil.to/744I35354M0"
,"https://filerio.in/nr435345oy8veq"
,"https://mirrorace.com/m/143538h"
,"https://download.jheberg.net/9pv2rewt80f4"
,"https://www.indishare.me/ys7dwhretewldm5"
,"https://www85.zippyshare.com/v/lOtryrx7"
,"https://www.sendspace.com/file/8345370j8"
,"https://1fichier.com/?rpc2lrandomltgwmx"];
我需要匹配filerio链接和她在数组中的位置
类似 Filerio = {filerio:link,array:[1]}
【问题讨论】:
-
这是静态列表吗?任何值都会改变吗?
-
使用正则表达式或
split从搜索字符串中获取域名。然后循环遍历数组,对每个元素执行相同的操作,并将其与从搜索字符串中获得的域进行比较。
标签: javascript arrays pattern-matching