|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Initial caps regex
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24958#125726
Only about 5 months -- ironically, our test box is CFMX, because we've been
trying to migrate. However, the original migration date was cancelled
because my boss's dad had a heart attack, and when we finally tried to
migrate it (me being in KY, my bosses and the box in FL) it was unsuccessful
and we had to roll back to CF5.
:-(
I'd love to be struggling with CFC's -- I was trained on C/C++ and miss
objects. I write UDFs for just about everything, and the error messages
I've run into, while occasionally cryptic, were often more helpful than the
5 ones.
-- Ben Doom
Programmer & General Lackey
Moonbow Software, Inc
: -----Original Message-----
:
: Sent: Friday, June 20, 2003 8:18 PM
: To: CF-Talk
: Subject: Re: Initial caps regex
:
:
: At least you haven't been struggling with CFCs and cryptic error messages
: for a year! ;-)
:
: ----- Original Message -----
: From: "Ben Doom" <bdoom-hof@moonbow.com>
: To: "CF-Talk" <cf-talk@houseoffusion.com>
: Sent: Saturday, June 21, 2003 1:48 AM
: Subject: RE: Initial caps regex
:
:
: > I would say gratifyingly simple. Very elegant, too.
: >
: > But only on MX, cries the boy trapped in 5.
: >
: >
: > -- Ben Doom
: > Programmer & General Lackey
: > Moonbow Software, Inc
: >
: > : -----Original Message-----
: > :
: > : Sent: Thursday, June 19, 2003 9:41 PM
: > : To: CF-Talk
: > : Subject: Initial caps regex
: > :
: > :
: > : 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?
: > :
: > :
: > :
: >
:
Author: Matthew Walker
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24958#125698
At least you haven't been struggling with CFCs and cryptic error messages
for a year! ;-)
----- Excess quoted text cut - see Original Post for more -----
Author: Ben Doom
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24958#125529
I would say gratifyingly simple. Very elegant, too.
But only on MX, cries the boy trapped in 5.
-- Ben Doom
Programmer & General Lackey
Moonbow Software, Inc
: -----Original Message-----
:
: Sent: Thursday, June 19, 2003 9:41 PM
: To: CF-Talk
: Subject: Initial caps regex
:
:
: 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?
:
:
:
Author: Matthew Walker
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:24958#125505
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?
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||