匹配单行注释:\/\/.*$;
\/\/.*$
匹配多行注释:\/\*(\*)?(((?!\*\/)[\s\S])+)?\*\/。
\/\*(\*)?(((?!\*\/)[\s\S])+)?\*\/
来源:How to delete all comment lines in IDEA?