I\'m searching a file line by line for the occurrence of ##random_string##. It works except for the case of multiple #...
pattern=\'##(.*?)##\' prog=re.compile(p
'^#{2,}([^#]*)#{2,}' -- any number of # >= 2 on either end
'^#{2,}([^#]*)#{2,}'
be careful with using lazy quantifiers like (.*?) because it'd match '##abc#####' and capture 'abc###'. also lazy quantifiers are very slow