Thanks Ben, I'm coming to the same conclusion, only after hours of head
scratching.

-----Original Message-----
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: 07 January 2005 15:08
To: CF-Talk
Subject: Re: Regex again


Actually, this isn't simple.  Offhand, I don't see a way to do this with

regex that isn't more complicated than other methods.  What you are 
really asking to do is parse an HTML page and selectivly replace tokens.

The easiest way I see to do it -- and this isn't particularly robust -- 
is to remove the head and the foot from the page, find tables and lists,

and split up what's left where the tables and lists where.  Then, do 
your replace.

I know that's not the answer you wanted, but it's the answer I got. 
Hopefully, someone smarter (and with more caffiene in their system) has 
a better suggestion.

--Ben

Craig Dudley wrote:
> OK, a regular expressions is doing my head in again, can anyone help?
> 
> What I'm trying to do is, match and replace all new line characters 
> with <br> that are not inside html such as tables or lists, e.g. in 
> the following string I would not want to add a <br> while I'm inside 
> the ordered list.
> 
> <cfset testString = "
> 
> A test string
> 
> with lots of line
> 
> breaks
> <ol>
>       <li>1</li>
>       <li>2</li>
>       <li>3</li>
> </ol>
> on several
> 
> lines
> ">
> 
> Sounds fairly simple?
> 
> The \n bit for finding line breaks is at least ;D
> 
> Craig Dudley
> Senior Developer
> Netstep Corporate Communications Ltd
> Direct Line: +44(0) 1422 319712
> Phone: +44(0) 1422 200308
> Fax: +44(0) 1422 200306
> e-mail: [EMAIL PROTECTED]
> MS Messenger: [EMAIL PROTECTED]
> www: www.netstep.co.uk
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189646
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to