如何删除JavaScript中字符串中/ *和* /(包括这些字符)之间的所有文本?谢谢!
答案 0 :(得分:5)
/\/\*.*?\*\//g
your_str = your_str.replace(/\/\*.*?\*\//g, '');
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