Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用正则表达式找到这种模式?
C 样式块注释
/* xxxxxxxxxxxx */
尝试使用
\/\*(\*(?!\/)|[^*])*\*\/
捕获单行和多行块注释。它搜索/*后跟任意数量的:
/*
*
/
然后*/再次关闭。
*/