Try this:

REReplaceNoCase(agents, "(</?)agent([[:space:]]*>|[[:space:]]+[^>]*>)",
"\1a\2", "ALL")

I have tested this code on CFAS 5 on WinXP.

James Ang
Senior Programmer
MedSeek, Inc.


-----Original Message-----
From: Troy Simpson [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 2:15 PM
To: CF-Talk
Subject: REReplace and RegExp


Dear CF-Talkers:

I have a string in the following format( I've added carriage returns for
readability):

<cfset agents =
'<agent primary="NO" aid="157" acutter="O469">Oldenburg, Claes Thure,
b.1929</agent>' & '<agent primary="NO" aid="2481"
acutter="B847">Bruggen, Coosje van, b.1942</agent>' & '<agent
primary="YES" aid="9387" acutter="B343">Berger, Patrick, b.
1947</agent>'
>

I want to process the string to look like this (replace the AGENT tags
with ANCHOR tags):

<cfset agents =
'<a href="results.cfm?c=aid&q=157">Oldenburg, Claes Thure, b.1929</a>' &
'<a href="results.cfm?c=aid&q=2481">Bruggen, Coosje van, b.1942</a>' &
'<a href="reulsts.cfm?c=aid&q=9387">Berger, Patrick, b. 1947</a>'
>

I have somewhat accomplished this like so but still need some work and
have become a little lost.

REReplaceNoCase(
    agent,

'<agent[[:space:]]+primary="(YES|NO)"[[:space:]]+aid="([0-9]*)"[[:space:
]]+a
cutter="([a-z0-9]*)">(.*)?</agent>',
        ' <a href="results.cfm?c=aid&q=\2">\4</a> ',
        "ALL")>

**Another problem is that the AGENT Attributes can be in any order which
really throughs wrench into things.

Anyone have any advise on how to approach this?
I would really appreciated it.

Thanks,
Troy


------------------------------------------
Troy Simpson
Applications Analyst/Programmer - MCSE, OCP-DBA
North Carolina State University Libraries
Campus Box 7111 | Raleigh | North Carolina
ph.919.515.3855 | fax.919.513.3330
[EMAIL PROTECTED]


______________________________________________________________________
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