Action Rules and Types for case conversion

I am using version 3.36.1

I have an Action Type that correctly addresses word contractions. However, I was unsuccessful trying to create an action type to capitalize the first letter of words that follow an apostrophe that have nothing before the apostrophe ('Bout, 'Cause, 'Round, etc.) without affecting already contracted words. Most attempts turned words like can't into Can'T.

I was also unsuccessful creating an Action Type to capitalize the first letter of each word in a multi-hyphenated term. I want to turn things like tee-nah-nah-nah or diddle-da-diddle into Tee-Nah-Nah-Nah and Diddle-Da-Diddle. But no luck. It only capitalizes the first section: Tee-nah-nah-nah and Diddle-da-diddle.

Any help would be appreciated!

Try Format value with
Format string: $regexp(%title%,\s+''(\l), ''\u$1)

Add the hyphen as "Words begin from /after any of" in the action of the type "Case conversion" for Mixed case.

This works fine if the word has a whitespace \s before the apostrophe.
However, the OP is asking for "that have nothing before the apostrophe".
Perhaps I have misunderstood this request, but wouldn't "nothing" be different from "whitespace"?

The suggested expression works for all apostrophes as word starters as long as this word isn't also the start of the field.
I would say: try it, then refine it if at all.

In such cases I find positive/negative lookahead/lookbehind to be the most useful approach.

Contractions

Action type:
Replace with regular expression
Field:
TITLE
Regular expression:

(?<![Ia-z]')(?<=')([a-z])

Replace matches with:
\u$1

If you also want to capitalize other letters (for example äöü), you might want to add them to the second character class like this: [a-zäöü].

Multi-hyphenated:

Action type:
Replace with regular expression
Field:
TITLE
Regular expression:

(?<=[a-z]-)([a-z])|(?<![a-z])([a-z])(?=[a-z]+-)

Replace matches with:
\u$1\u$2

Tests

Do note that I only performed limited testing for both, your data might contain other cases that are not covered.

Tests for contractions:

Tests for multi-hyphenated:

If it might be useful to the discussion, modification the solution to the regex proposed by @ohrenkino to capitalize the first letters of words following an apostrophe—specifically those with nothing preceding the apostrophe.

With space
Format value
$regexp(%title%,''(\l), ''\u$1)

Example: Music'bout,'cause,'round
Result: Music 'Bout, 'Cause, 'Round

Without space
Format value
$regexp(%title%,''(\l),''\u$1)

Example: Music'bout,'cause,'round
Result: Music'Bout,'Cause,'Round

The problem with the apostrophe in the middle is that this would also transform "isn't" into "isn'T" (etc.) - this could also be achieved with the case conversion action and the apostrophe added as word separating character.

If you want to match those cases but not standard contractions, you can get more specific.

I've used this list of standard contractions as the test data.
By only adding characters to the character class in the negative lookbehind that exist in standard contractions right before the ', they are left untouched.

Regular expression:

(?<![adeghInotuwy]')(?<=')([a-z])

Replace with:
\u$1

Test string
Music'bout,'cause,'round


don't didn't isn't wasn't aren't weren't hasn't haven't hadn't can't couldn't
shan't shouldn't won't wouldn't mightn't mustn't oughtn't needn't could've
should've would've might've must've I'm you're she's he's it's we're they're I've
you've we've they've I'll you'll he'll she'll it'll we'll they'll I'd you'd she'd
he'd it'd we'd they'd that's that've that'd which've who's who're who've who'd
who'll what's what're what'll where's where'd when's why's why'd how's here's
there's there'll there'd someone's somebody's no one's nobody's something's
nothing's let's ma'am o'clock

And when you want to insert a space before the single quote:

Regular expression:

(?<![adeghInotuwy])'([a-z])

Replace with:
'\u$1