Thx Stephen and Adrian,

You were both spot on with the requirement of a back reference.

Regards

Mike



-----Original Message-----
From: Stephen Moretti [mailto:[EMAIL PROTECTED] 
Sent: 26 January 2004 15:38
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] Regular Expression Help



newstring = REReplace(mystring,"(image[0-9]{1,3})","\1.jpg","ALL");

does the trick....

Probably the same as what Adrian just suggested...

BTW - I skipped worrying about the double quote after the number and 
told the expression to match the text image and 1 to 3 numbers from 0 to

9, so that should cover image1 through to image999

Stephen

Mike Connolly wrote:
> I have a table of content paragraphs which contain content along these

> lines.
>  
> ' <p>Blurb Title</p><img src="/uploads/image123" width=124 align=left 
> vspace=5 border=0> blah, blah, blah... '
>  
> What I need to do is replace image123 with image123.jpg where the 
> Image ID (123) changes for each record of content.
>  
> What I have tried so far is....
>  
> ReReplaceNoCase(GetContent.LongDesc,"image[0-9]*",".jpg","ALL")
>  
> but this does...
>  
> ' <p>Blurb Title</p><img src="/uploads/.jpg" width=124 align=left 
> vspace=5 border=0> blah, blah, blah... '
>  
> What I need is a regular expression that replaces the single " after 
> the image ID (123) with .jpg" to result in....
>  
> ' <p>Blurb Title</p><img src="/uploads/image123.jpg" width=124 
> align=left vspace=5 border=0> blah, blah, blah... '
>  
> Anyone any ideas?
>  
> Regards
>  
> Mike
> 

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] For
human help, e-mail: [EMAIL PROTECTED]


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to