On Thu, Oct 2, 2008 at 18:15, Ian Skinner <[EMAIL PROTECTED]> wrote:
> The trick being that this has to work on a ColdFusion 4.5 server, so the
> /u switch is apparently out!

Does it work if you put the slash the right way round? (it's \u not /u)

Can CF4.5 use Java objects? If so, you can use RegEx within Java.


> I have reReplace(myString,'(^.| .)','-\1-','ALL') working so that it
> captures the first character of all the words.

Hmmm, at the very least those "." should almost certainly be "\w".
Depending on what you're actually doing, simply "\b\w" might be better.
(But that doesn't help without being able to act on the results)


>  Now I need to find away
> to convert the back reference to an upper case version of itself.
>
> Anybody got any ideas?

Other than using Java, if possible, I can't think of a RegEx solution for this.

However, this is a crude non-RegEx solution that might be good enough for you:

<cfloop index="i" from="1" to="#ListLen(myString,' ')#">
        <cfset CurWord = ListGetAt( myString , i , ' ' )/>
        <cfset CapsWord = UCase(Left(CurWord,1)) & 
Right(CurWord,Len(CurWord)-1)/>
        <cfset myString = ListSetAt( myString , i , CapsWord , ' ' )/>
</cfloop>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/regex/message.cfm/messageid:1177
Subscription: http://www.houseoffusion.com/groups/regex/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21

Reply via email to