[TAG] Filters

Jimmy O'Regan jimregan at o2.ie
Sun Apr 18 18:41:37 MSD 2004


Ben Okopnik wrote:

>On Sun, Apr 18, 2004 at 08:32:32AM +0100, Jimmy O'Regan wrote:
>  
>
>>Ben Okopnik wrote:
>>
>>    
>>
>>>In fact, a number of programmers do something like this for names (which
>>>is going to be wrong in a number of cases, but can be a reasonable
>>>compromise):
>>>
>>>print join " ", map ucfirst lc, split "Joe Q. Fuzzball";
>>>
>>>      
>>>
>>Heh. Since my surname is so frequently mangled, I think I'd have to go 
>>that extra mile.
>>    
>>
>
>Heck, Jimmy - you're _easy._ :) You've got a non-word character
>preceding every letter to be capped (and this, in fact, is _my_ favorite
>way to properly capitalize MP3 names):
>
>perl -wle'($_=lc pop) =~ s/(?<!\w)(\w)/\u$1/g; print' "JIMMY O'REGAN"
>
>RE lookbehinds. Love'em.
>  
>
Cool. I'll remember that the next time I have some web form choke on my 
name :)





More information about the TAG mailing list