[Tutor] re.search() help

Michael Lewis mjolewis at gmail.com
Sun Apr 15 09:10:35 CEST 2012

Hi everyone,

I am a bit confused on how one would ever use re.search(). It essentially
tells me the location on (RAM?) if the pattern matches? What is the purpose
of this? Can you give me a good example of where it would be useful?


re.search(*pattern*, *string*,

Scan through *string* looking for a location where the regular expression *
pattern* produces a match, and return a corresponding
Return None if no position in the string matches the pattern; note that
this is different from finding a zero-length match at some point in the

Michael J. Lewis
mjolewis at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120415/632eb9be/attachment.html>

More information about the Tutor mailing list