caps for 'irish' names but not contractions?

OK I'm sure this has been asked but I couldn't find it and am getting frustrated

I need a script to capitalize names such as

Sinead O'Connor

where a word starts with O' it caps the next letter after the O'

but not if the ' is in the middle of a word like can't, don't or won't

All I've managed to do is create Can'T, Don'T, Won'T

Not so hot with regular expressions myself and could use help


Try this regular expression ...


i didn't see sinead o'connor live, shouldn't have i?
i didn't see sinead O'Connor live, shouldn't have i?


I believe that does that trick. Thanks.

Thanks so much for the help.

I've also just seen the reply from Lee in the original post page, so I'm gonna try that first.