Hey I've just been playing with CFMX regular expressions and thought I'd
share. You can write this to force initial caps:

<cfset initialCapsText = rereplace(text, "(\b\w)", "\u\1", "all")> 

\b marks a transition to or from a word, \w marks an alphanumeric, \u means
capitalize the next char, and \1 is a back reference. Alarmingly simple, eh?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to