in reply to Re^2: Regex Substitution Evaluations
in thread Regex Substitution Evaluations
I think pc88mxer answered your question for the most part.
$my_name = replace("august ferdinand mobius","\b(\w)","\U$1","igs"); # Becomes something more like... $my_name = replace("august ferdinand mobius", qr/(?igs)\b(\w)/, '\U$1' +);
Update: You should consider that your solution will not work for a variety of names, like mccleod, vomdorp, decaro, etc. For proper names, a dictionary (with the right library under it, like proper names) is a better way to go, and there is no perfect solution since the same spellings are sometimes capitalized differently. :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Regex Substitution Evaluations
by oko1 (Deacon) on Jul 05, 2008 at 22:31 UTC | |
|
Re^4: Regex Substitution Evaluations
by mobiusinversion (Beadle) on Jul 07, 2008 at 18:53 UTC |