Re: Extracting patterns after matching a regex

2009-09-11 Thread Mart.
On Sep 9, 4:58 pm, Al Fansome wrote: > Mart. wrote: > > On Sep 8, 4:33 pm, MRAB wrote: > >>Mart. wrote: > >>> On Sep 8, 3:53 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > > Hi, > > I need to extract a string after a matching a regular expr

Re: Extracting patterns after matching a regex

2009-09-09 Thread Al Fansome
Mart. wrote: On Sep 8, 4:33 pm, MRAB wrote: Mart. wrote: On Sep 8, 3:53 pm, MRAB wrote: Mart. wrote: On Sep 8, 3:14 pm, "Andreas Tawn" wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and onc

Re: Extracting patterns after matching a regex

2009-09-09 Thread MRAB
Mart. wrote: On Sep 8, 4:33 pm, MRAB wrote: Mart. wrote: On Sep 8, 3:53 pm, MRAB wrote: Mart. wrote: On Sep 8, 3:14 pm, "Andreas Tawn" wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and onc

Re: Extracting patterns after matching a regex

2009-09-09 Thread Mart.
On Sep 8, 4:33 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:53 pm, MRAB wrote: > >> Mart. wrote: > >>> On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > >>> Hi, > >>> I need to extract a string after a matching a regular expression. For > >>> example I have the string... > >>> s = "FT

Re: Extracting patterns after matching a regex

2009-09-08 Thread Terry Reedy
Mart. wrote: If, as Terry suggested, you do have a tuple of strings and the first element has FTPHOST, then s[0].split(":")[1].strip() will work. It is an email which contains information before and after the main section I am interested in, namely... FINISHED: 09/07/2009 08:42:31 MEDIATYPE

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 4:33 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:53 pm, MRAB wrote: > >> Mart. wrote: > >>> On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > >>> Hi, > >>> I need to extract a string after a matching a regular expression. For > >>> example I have the string... > >>> s = "FT

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 12:16 pm, nn wrote: > On Sep 8, 11:19 am, Dave Angel wrote: > > > > > Mart. wrote: > > > > > > I have been doing this to turn the email into a string > > > > email =ys.argv[1] > > > f =open(email, 'r') > > > s =str(f.readlines()) > > > > so FTPHOST isn't the first element, it is just p

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 11:19 am, Dave Angel wrote: > Mart. wrote: > > > > I have been doing this to turn the email into a string > > > email =ys.argv[1] > > f =open(email, 'r') > > s =str(f.readlines()) > > > so FTPHOST isn't the first element, it is just part of a larger > > string. When I turn the email int

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 10:25 am, "Mart." wrote: > On Sep 8, 3:21 pm, nn wrote: > > > > > On Sep 8, 9:55 am, "Mart." wrote: > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > > Hi, > > > > > > I need to extract a string after a matching a regular expression. For > > > > > example I have the string...

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 10:27 am, pdpi wrote: > On Sep 8, 3:21 pm, nn wrote: > > > > > On Sep 8, 9:55 am, "Mart." wrote: > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > > Hi, > > > > > > I need to extract a string after a matching a regular expression. For > > > > > example I have the string... >

Re: Extracting patterns after matching a regex

2009-09-08 Thread MRAB
Mart. wrote: On Sep 8, 3:53 pm, MRAB wrote: Mart. wrote: On Sep 8, 3:14 pm, "Andreas Tawn" wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4

Re: Re: Extracting patterns after matching a regex

2009-09-08 Thread Dave Angel
Mart. wrote: I have been doing this to turn the email into a string email =ys.argv[1] f =open(email, 'r') s =str(f.readlines()) so FTPHOST isn't the first element, it is just part of a larger string. When I turn the email into a string it looks like... 'FINISHED: 09/07/2009 08:42:31\r\n', '\r

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 3:53 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > > Hi, > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > and once I match "FTPHOST"

Re: Extracting patterns after matching a regex

2009-09-08 Thread MRAB
Mart. wrote: On Sep 8, 3:14 pm, "Andreas Tawn" wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4ftl01u.ecs.nasa.gov". I am not sure as to the b

Re: Extracting patterns after matching a regex

2009-09-08 Thread pdpi
On Sep 8, 3:21 pm, nn wrote: > On Sep 8, 9:55 am, "Mart." wrote: > > > > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 3:21 pm, nn wrote: > On Sep 8, 9:55 am, "Mart." wrote: > > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" >

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > > > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > > > and once I match "FTPHOST" I would like to extract > > > > "e4ftl01u.ec

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 9:55 am, "Mart." wrote: > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > > Hi, > > > > I need to extract a string after a matching a regular expression. For > > > example I have the string... > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > > and once I match "FTPHOST" I would lik

RE: Extracting patterns after matching a regex

2009-09-08 Thread Andreas Tawn
> > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > > > and once I match "FTPHOST" I would like to extract > > > "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approa

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > Hi, > > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > and once I match "FTPHOST" I would like to extract > > "e4ftl01u.ecs.nasa.gov". I am not su

RE: Extracting patterns after matching a regex

2009-09-08 Thread Andreas Tawn
> Hi, > > I need to extract a string after a matching a regular expression. For > example I have the string... > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > and once I match "FTPHOST" I would like to extract > "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approach to the > problem, I had

Re: Extracting patterns after matching a regex

2009-09-08 Thread Terry Reedy
Mart. wrote: On Sep 8, 2:15 pm, MRAB wrote: Martin wrote: Hi, I need to extract a string after a matching a regular expression. Whether or not you need re is an issue to be determined. >>> For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I wo

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 2:21 pm, "Mark Tolonen" wrote: > "Martin" wrote in message > > news:5941d8f1-27c0-47d9-8221-d21f07200...@j39g2000yqh.googlegroups.com... > > > > > Hi, > > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > > s = "FTPHOST: e4ftl01

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 2:15 pm, MRAB wrote: > Martin wrote: > > Hi, > > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > and once I match "FTPHOST" I would like to extract > > "e4ftl01u.ecs.nasa.gov". I am

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mark Tolonen
"Martin" wrote in message news:5941d8f1-27c0-47d9-8221-d21f07200...@j39g2000yqh.googlegroups.com... Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract

Re: Extracting patterns after matching a regex

2009-09-08 Thread pdpi
On Sep 8, 1:56 pm, Martin wrote: > Hi, > > I need to extract a string after a matching a regular expression. For > example I have the string... > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > and once I match "FTPHOST" I would like to extract > "e4ftl01u.ecs.nasa.gov". I am not sure as to the best ap

Re: Extracting patterns after matching a regex

2009-09-08 Thread MRAB
Martin wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approach to the problem, I had been

Extracting patterns after matching a regex

2009-09-08 Thread Martin
Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approach to the problem, I had been trying to match