Helpful Information
 
 
Category: Python
Regular Expression problem

I am newish to regex's, but I don't understand why this does not work:

re.sub('\/\/(.*)/n' , "\n", inputstr)

what I am trying to do is replace all the chars in inputstr between "//" and <newline> with a newline char.

Can someone please explain to me how the RE should be made?

you need do get rid of the second '/', it makes it think that the parenthesis are not meta characters.










privacy (GDPR)