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
>>> import SE >>> Editor = SE.SE ('sleeping=dead sleeping.htm== sleeping<==') >>> Editor ('This parrot is sleeping. Really, it is sleeping.' 'This parrot is sleeping. Really, it is dead.' Or: >>> Editor ( (name of htm file), (name of output file) ) Usage: You make an explicit list of what you want

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