I use re.match to find the string like this:
print(re.match('''#include(\s)?".*"''', '''#include "my.h"'''))
then I got the result like this:
<_sre.SRE_Match object; span=(0, 15), match='#include "my.h"'>
and then I replace match function:
print(re.findall('''#include(\s)?".*"''', '''#include "my.h"'''))
the result is:
[' ']
I was confused, why dosen't re.findall
return the matched string? What's wrong with my regular expression?