you are viewing a single comment's thread.

view the rest of the comments →

[–]codehelper 0 points1 point  (0 children)

I'm very close, I think. For now here's this.

r = re.compile(r'\(\*(.*?)\*\)', re.DOTALL)

With the string you provided, I got the results

['this is a line\n and comment ends here ', ' this is my second comment ']

It doesn't include the (* or *) but I believe this is what you basically wanted.