Re: RegEx conditional search and replace

2006-07-06 Thread Blair P. Houghton
mbstevens wrote: > In such a case you may need to make the page > into one string to search if you don't want to use some complex > method of tracking state with variables as you move from > string to string. In general it's a very hard problem to do stateful regexes. I recall something from las

Re: RegEx conditional search and replace

2006-07-06 Thread Martin Evans
"mbstevens" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 06 Jul 2006 08:32:46 +0100, Martin Evans wrote: > >> "Juho Schultz" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> Martin Evans wrote: Sorry, yet another REGEX question. I've been struggling

Re: RegEx conditional search and replace

2006-07-06 Thread mbstevens
On Thu, 06 Jul 2006 08:32:46 +0100, Martin Evans wrote: > "Juho Schultz" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Martin Evans wrote: >>> Sorry, yet another REGEX question. I've been struggling with trying to >>> get >>> a regular expression to do the following example i

Re: RegEx conditional search and replace

2006-07-06 Thread Anthra Norell
ogram. Gudidance welcome. In the interim I can send SE out individually by request. Regards Frederic - Original Message - From: "Martin Evans" <[EMAIL PROTECTED]> Newsgroups: comp.lang.python To: Sent: Wednesday, July 05, 2006 1:34 PM Subject: RegEx conditional search and r

Re: RegEx conditional search and replace

2006-07-06 Thread Martin Evans
"Juho Schultz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Martin Evans wrote: >> Sorry, yet another REGEX question. I've been struggling with trying to >> get >> a regular expression to do the following example in Python: >> >> Search and replace all instances of "sleeping" wi

Re: RegEx conditional search and replace

2006-07-05 Thread Juho Schultz
Martin Evans wrote: > Sorry, yet another REGEX question. I've been struggling with trying to get > a regular expression to do the following example in Python: > > Search and replace all instances of "sleeping" with "dead". > > This parrot is sleeping. Really, it is sleeping. > to > This parrot is

RegEx conditional search and replace

2006-07-05 Thread Martin Evans
Sorry, yet another REGEX question. I've been struggling with trying to get a regular expression to do the following example in Python: Search and replace all instances of "sleeping" with "dead". This parrot is sleeping. Really, it is sleeping. to This parrot is dead. Really, it is dead. But n