[Tutor] re module

Danny Yoo dyoo at hashcollision.org
Fri Aug 15 00:02:11 CEST 2014


On Thu, Aug 14, 2014 at 8:39 AM, D.V.N.Sarma డి.వి.ఎన్.శర్మ
<dvnsarma at gmail.com> wrote:
> I tested it on IDLE. It works.


Hi Sarma,


Following up on this one.  I'm pretty sure that:

    print re.search("<span style=\"(.*)\"", stmt).group()

is going to print something, but it almost certainly will not do what
Sunil wants.  See:

    https://docs.python.org/2/howto/regex.html#greedy-versus-non-greedy

for why.


More information about the Tutor mailing list