Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Re: Handling caps for surnames with capitals in the middle (was: Irish Surnames)

by ariels (Curate)
on May 06, 2002 at 12:02 UTC ( [id://164294]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Handling caps for surnames with capitals in the middle (was: Irish Surnames)
in thread Handling caps for surnames with capitals in the middle (was: Irish Surnames)

If it were my surname you were mauling, I'd be more than a bit annoyed. I get enough of my surname's Anglicised (actually Brazilinated, but it's close enough) form being auto-"corrected" into the original Russian. I am actually capable of spelling it correctly, and I do just that.

That said, you could

$surname =~ s/^((?:Mc|Mac|De|Da|Du)?)(.*)$/\u\1\u\2/i;
(assumes the surname starts off lower-cased).

Other problems: not smart enough. E.g. <samp>'mack'</samp> becomes <samp>'MacK'</samp>, which is wrong; you might want .{3,} instead of .* in the regexp.

But I really don't think you should be doing this...

  • Comment on Re: Re: Re: Handling caps for surnames with capitals in the middle (was: Irish Surnames)
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://164294]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found