[Tutor] Searching list items.
Chris Hengge
pyro9219 at gmail.com
Wed Oct 18 06:29:42 CEST 2006
Not sure if you were challenging me to think, or asking me, but I was
wanting to "line" to be printed... as in the string from the list. What I
got with re was what I'm assuming was a memory address.
On 10/17/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
>
>
>
> > I remove those lines, but I was trying to use
> > for line in contents:
> > result = re.search("something", line)
> > print result
>
> 'result' here is going to either be None, as you've seen, or a "match"
> object. We have several options available to use once we have a
> match. Take a look at a few of the methods in here:
>
> http://www.python.org/doc/lib/match-objects.html
>
> Printing a match object itself won't be too informative. What would you
> like to show up if there is some match?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061017/6bb5929b/attachment.html
More information about the Tutor
mailing list