If this is the actual code you are using, you are creating an infinite
loop because you always start looking at the start position 1 in your
REFind. It will keep matching the first {}.

It really depends what you are trying to grab. If you are trying to get
only the inner parentheses it is not too hard. Now for the solution:

teststr = REReplaceNoCase(teststr,"\{([^{}]+)\}","{<a
href=""> >}","all");

Not tested, but it should work.

Pascal

> -----Original Message-----
> From: Paul Vernon [mailto:[EMAIL PROTECTED]
> Sent: 13 July 2004 18:17
> To: CF-Talk
> Subject: Regular _expression_ help with dictionary definitions
>
> Ok,
>
> This one is killing me.. And my CFMX server...
>
> Currently I'm using the following code to parse some text:
>
> <cfset teststr = definition>
> <cfset st = ReFindNoCase("{[^}]*}",
teststr,
> 1, true)>
> <cfloop condition="st.pos[1] GT 0">
> <cfset replaceme = mid(teststr,
> st.pos[1], st.len[1])>
> <cfset theword = mid(replaceme,
2,
> len(replaceme)-2)>
> <cfset teststr =
> ReplaceNoCase(teststr, replaceme, "<a
>
href=""> ">
> #t
> heword#</a>", "all")>
> <cfset st =
ReFindNoCase("{[^}]*}",
> teststr, 1, true)>
> </cfloop>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to