I have been trying to use the regex pattern >(\S.*?)<|#{1}\s+?(\w.*)
with the method re.findall
over the string
<h1 id="section">First Section</h1><a name="first section">
# Section_2
My expected result is two lists
["First Section"]
["Section_2"]
However, I get
["First Section",""]
["","Section_2"]
Does someone knows what I am doing wrong?
Thanks,