【发布时间】:2023-02-17 13:42:54
【问题描述】:
我需要一个正则表达式来匹配行尾的双斜杠注释,如果用引号引起来则忽略它:
something something // match this and the double slash
this address: "https://foo" but don't match this
我想在捕获组中捕获评论和斜杠。
我最初只有.*(/\/\/.*),但在引用的情况下失败了,我还没有设法找到如何做到这一点。
【问题讨论】:
标签: regex