Asking for Help: How to use reg. exp. to capture defined values from random text

...

(Note to admins ... this is my second attempt to add this page. The first time my carefully-crafted text was discarded by the confusing form to create this page. Thanks for that!)

Hi -

I'm a Python newbie. I HAVE and WILL CONTINUE to study the usages of regular expressions. But in the meantime, I'd appreciate any quick help that y'all can give me.

I'd like to learn how to capture data points defined by some known marker ('=', ':' or other) from random text. For example, I'd like to capture "date" and "ip address" from random text like:

"bla bla bla, loads of random data date = 03/04/2010 more random text ip address: 128.0.0.1 thanks for your help"

To clarify, I know the NAME of the value, I know the marker, I want to grab the value.

Thanks much for your help.

When answering questions, add the CategoryAskingForHelpAnswered category when saving the page. This will move the link to this page from the questions section to the answers section on the Asking for Help page.


CategoryAskingForHelp

Asking for Help/How to use Reg. Exp. to capture data from random text (last edited 2010-09-29 02:13:52 by 67-198-77-121)

Unable to edit the page? See the FrontPage for instructions.