最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】js中RegEx中Pattern中的双引号如何表示

JS crifan 4361浏览 0评论

想要写个js中的正则,pattern中:

var titleP = "<p\s+?class=""mid_tit"">(?<title>.+?)</p>";

包含双引号,不知道如何表示

是”"

还是\"

js regexp pattern double quotation marks

Regex for quoted string with escaping quotes – Stack Overflow

好像是\"

Pattern Matching with Regular Expressions (JavaScript: The Definitive Guide, 4th Edition)

Javascript regex to extract all characters between quotation marks following a specific word – Stack Overflow

RegExp – JavaScript | MDN

【总结】

js中RegEx中Pattern中的双引号,貌似是用:

\"

去表示。

转载请注明:在路上 » 【已解决】js中RegEx中Pattern中的双引号如何表示

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.303 seconds, using 22.12MB memory