I'm trying to run sql script in python during my data processing, the script file I used contains annotations surrounded by /**/ and I want to delete those annotations. Since I may have multiline annotations and multi annotation chunks in a single file, I'm using
re.sub('/\*((?!/\*).)*/\*','',cmd,flags=re.DOTALL)
but the above code will only replace those multiline annotations and ignore single line annotaions. Now I'm confused how to make it work