How can I match and delete all comments from the line? I can delete comments starting from new line, or the ones not in quotes using sed. But my script fails in the following examples
This one "# this is not a comment" # but this "is a comment"
Can sed handle this case? if yes what is the regex?
Example:
Input:
This one "# this is not a comment" # but this "is a comment"
Output:
This one "# this is not a comment"