

















这是一个创建于 1647 天前的主题,其中的信息可能已经有所发展或是发生改变。
我想要的结果 求个正则
const s = '/hello' // match[1] = hello
const s = '/hello/abcd' // match[1] = hello // match[2] = /abcd
const s = '/hello/' // match[1] = hello // match[2] = /
console.log(s.match(/\/([^\/]+)?(.+)/i))
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。