Yep, just didn't want to give away the answer without being asked.

(Sorry it took so long, got pulled away into a meeting)

First assumption: All the numbers are in the form [numbers].
Second assumption: Nothing else is in the form [numbers].

You want something along these lines.

<cfset newContent=rereplace("\[(\d*)\]",Content,"<a 
href=""here.cfm?v=\1"">view</a>","ALL")>

It says find any numeric digits between square brackets, and replace them with the 
view link.

Jerry Johnson

>>> [EMAIL PROTECTED] 05/06/02 02:33PM >>>
Jerry,

I'm really stumped as to where to start - could you give me a starter or
clue?

Thanks

Will
----- Original Message -----
From: "Jerry Johnson" <[EMAIL PROTECTED]>
Newsgroups: cf-talk
Sent: Monday, May 06, 2002 7:16 PM
Subject: Re: Looping to find [brackets]


> Yes, that is exactly the place to use rereplace.
>
> remember that square brackets are special chars in regex, so you need to
escape them.
>
> Jerry Johnson
>
> >>> [EMAIL PROTECTED] 05/06/02 12:30PM >>>
> Hi,
>
> I need to loop through a large amount of text - which might contain HTML -
> to find numbers surrounded by square brackets (i.e. [n]).
>
> Once found, I need to alter it into something like this:
>
> <a href="here.cfm?v=n">view</a>
>
> (where "n" is a number).  There will be about 30 square-bracketed numbers
> like this.  Does anyone have any advice how to tackle this - is this is a
> time for rereplace?
>
> Cheers
>
> Will
>
>
>
> -------
>
> Become a Pingographer and share your photos for free:
>
> http://www.localbounty.com/pingo 
>
> 

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to