Script Request...

Gerard Flanagan grflanagan at gmail.com
Thu Mar 20 07:09:51 EDT 2008


On Mar 19, 10:29 pm, some one <nore... at noreply.org> wrote:
> Thanks Diez, I found some docs and examples on urllib2.  Now how do i
> search the string I get from urllib2, lets say I put it in "myURL", How
> do I search for only Numbers and ".'s" in the "#.#.#.#" pattern.  That
> is all I am interested in with all the data retrieved.  Just the IP
> Address from amongst a bunch of data that I have no use of currently.
>
> I would I write a pattern matching function to extract only the IP
> address from "myURL"?
>

See the subsection titled 'Matching An IP Address', here:

http://www.oreilly.com/catalog/regex/chapter/ch04.html

Gerard

>
> > Show us your concrete efforts, and we will suggest improvements.
>
> > Diez




More information about the Python-list mailing list