如何在JavaScript中删除字符串中的/*和*/(包括这些字符)之间的所有文本?谢谢!
/\/\*.*?\*\//g
Run Code Online (Sandbox Code Playgroud)
your_str = your_str.replace(/\/\*.*?\*\//g, '');
Run Code Online (Sandbox Code Playgroud)
Match the character "/" literally
Match the character "*" literally
Match any single character that is not a line break character
Between zero and unlimited times, as few times as possible, expanding as needed (lazy)
Match the character "*" literally
Match the character "/" literally
Run Code Online (Sandbox Code Playgroud)