regexp question
by Jabba Laci other posts by this author
Nov 6 2009 1:57PM messages near this date
Re: Question about creating dictionary like objects
|
Re: regexp question
Hi,
How to find all occurences of a substring in a string? I want to
convert the following Perl code to Python.
Thanks,
Laszlo
==========
my $text = '<a href="ad1"> sdqs</a><a href="ad2">sds</a><a href=ad3>qs</a>';
while ($text =~ m#href="?(.*?)"?> #g)
{
print $1, "\n";
}
# output:
#
# ad1
# ad2
# ad3
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Jabba Laci
Rami Chowdhury
Jabba Laci
Jon Clements
|