I want to match this
(including whitespace) from:
def foo():
"""
this
"""
pass
but in this case i don't want to match anything:
# def foo():
# """
# this
# """
#
# pass
At the moment I am using """(.*?)"""
with the DOTALL-flag to catch the first example, but obviously that doesn't prevent the matching of the second part.
This regex doesn't work because it prevents any matches after the first occurance of #
: ^(?!#)"""(.*?)"""