正则表达式提取url中的ip地址
时间:2021-08-05 15:54:36
收藏:0
阅读:38
let url = ‘http://127.0.0.1:3000‘
let reg_str = /\d+\.\d+\.\d+\.\d+/
console.log(url.match(reg_str)) // ["127.0.0.1", index: 7, input: "http://127.0.0.1:3000"]
原文:https://www.cnblogs.com/lyt520/p/15102810.html
评论(0)