BTW although this seems to have been resolved, there is another way of
handling the ".*" problem in regular expressions.

The problem is that "<tr[^>]*>.*</tr>" will capture anything, including
duplicate occurances </tr> inside the .*

So, instead, you take the string you are searching and convert all instances
of "</tr>" to a single rare character, e.g. "~". You would probably use a
rarer character but for this email I didn't want to screw up the email's
character set.

So, you run these two expressions:

rereplacenocase(text,'</tr>','~','All')
refindnocase(text,'<tr[^>]*>[^~]*~')
..and convert back if necessary.

Make sense? Anyone know a better way?

Paolo

> -----Original Message-----
> From: Paul Johnston [mailto:[EMAIL PROTECTED]
> Sent: 18 March 2004 10:28
> To: [EMAIL PROTECTED]
> Subject: Re: [ cf-dev ] OT: Regular Epressions
> 
> 
> In fact, the way I would do it is to use a find instead of a regex...
> 
> Find the next occurrence of <tr
> set iterator to 0
> loop
>       if find <td add 1 to iterator
>       if find </tr>
>               end loop
> if iterator is equal to 3, then it's a row you can work on
> else find next occurrence of <tr (back to start)
> 
> This code would be more robust as regexes are there for pattern 
> matching, *but* in this case, figuring out the pattern is going to be 
> complicated (ie it's more complex and a waste of time it seems than 
> doing it the above way).
> 
> HTH
> 
> Paul
> 
> -- 
> These lists are syncronised with the CFDeveloper forum at 
> http://forum.cfdeveloper.co.uk/
> Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>  
> CFDeveloper Sponsors and contributors:-
> *Hosting and support provided by CFMXhosting.co.uk* :: 
> *ActivePDF provided by activepdf.com*
>       *Forums provided by fusetalk.com* :: *ProWorkFlow 
> provided by proworkflow.com*
>            *Tutorials provided by helmguru.com* :: *Lists 
> hosted by gradwell.com*
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> 

-- 
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to