I make use of an action in conjunction with a regex to generate Firstlettercaps strings for all words in a string, excepting a predefined list of words which should always be formatted lowercase. The regex works for the most part, but I do get exceptions, e.g. "I'm" and/or "i'm" returns "I'M" instead of "I'm". As it turns out, I'm unable to spot my error, so I'm hoping someone out there can give me a hand. Here's the code:
Firstly, I apply a case conversion Mixed case action, with words beginning after any of: .([/"
Then I apply a regex as follows:
\b(?:M{0,3})(?:D?C{0,3}|C[DM])(?:L?X{0,3}|X[LC])(?:V?I{0,3}|I[VX])(?=(\.\s|\s|\)|$))
replace matches with $upper($0)
followed by another regex as follows:
\s(a|an|and|as|at|by|but|de|di|en|for|from|in|is|of|on|op|or|out|the|to|van|
with)(?=\s)
replace matches with $lower($0)
Hmm, now if only I could edit the topic header or delete the post I'd correct the subject error!
