Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Regex Typecase

by halley (Prior)
on Aug 14, 2007 at 14:39 UTC ( [id://632508]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex Typecase
in thread Regex Typecase

The library rules for title case are even more complicated than that. I learned that you capitalize the first and last words, even if they ARE prepositions or articles. You're right in that the edge cases like apostrophes and multiple capitals (e.g., "McDonald's") are annoyingly complicated to get right.

For my website, I have a "turn filenames into titles" function. For example, a-sunrise-to-remember.jpg becomes "A Sunrise to Remember" which uses a small canned list of the most common prepositions and articles (including a few in Spanish). Every once in a while, I find I have to add yet another special case.

--
[ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found