G
GrelEns
hello,
i had a trouble with re that i didn't understand (this is a silly example to
show, to parse html i use sgmllib) :
having this string :
<input type="text" name="title" size="1." value="test...">
<br>
<a href="help.php">help</a>
</form>"""
why do i get :
[]
while i was expected this kind of behaviour :
['form name="test" method="post" action="test.php">\n<input type="text"
name="title" size="1." value="test...">\n<br>\n<a href="help.php">help</a>']
which what i nearly get with .findall(s.replace('\n', ''))
['<form name="test" method="post" action="test.php"><input type="text"
name="title" size="1." value="test..."><br><a href="help.php">help</a> ']
it looks like \n isn't matched by . (dot)* in my re while i though (and
need) it should, i must be missing something.
thanks!
i had a trouble with re that i didn't understand (this is a silly example to
show, to parse html i use sgmllib) :
having this string :
<input type="text" name="title" size="1." value="test...">
<br>
<a href="help.php">help</a>
</form>"""
why do i get :
[]
while i was expected this kind of behaviour :
['form name="test" method="post" action="test.php">\n<input type="text"
name="title" size="1." value="test...">\n<br>\n<a href="help.php">help</a>']
which what i nearly get with .findall(s.replace('\n', ''))
['<form name="test" method="post" action="test.php"><input type="text"
name="title" size="1." value="test..."><br><a href="help.php">help</a> ']
it looks like \n isn't matched by . (dot)* in my re while i though (and
need) it should, i must be missing something.
thanks!