简体   繁体   English

正则表达式 HTML 注释 (PCRE)

[英]Regex HTML comments (PCRE)

I am trying to get the mediaID from an HTML block however I couldn't figure out a way to skip all the other parts and only get the mediaIDs within the HTML block?我试图从 HTML 块中获取 mediaID,但是我想不出一种方法来跳过所有其他部分而只获取 HTML 块中的 mediaID?

<!-- wp:pdf-viewer-block/standard {"mediaID":5943} -->

I can select the HTML comment with the followings:我可以使用以下内容选择 HTML 注释:

<!-- .* -->

Could you please show me a way to only get the mediaIDs?你能告诉我一种只获取mediaID的方法吗?

解决此问题并获得该数字的正确正则表达式:

<!-- wp:pdf-viewer-block.?standard {"mediaID":(.*?)} -->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM