一句正则表达式删除所有C语言注释

2019PHP高薪工程师学习路线图....>>>

import re
code_file = open('test.c','r')
code_content = code_file.read()
code_content_temp = re.sub(r'((?<=\n)|^)[ \t]*\/\*.*?\*\/\n?|\/\*.*?\*\/|((?<=\n)|^)[ \t]*\/\/[^\n]*\n|\/\/[^\n]*','',code_content)
print(code_content_temp)