O'dxxx to O'Dxxx

Is there a way of correcting the Irish surname commonality, so, for example, changing O'dowd to O'Dowd?
Many thanks,

This maybe helps !

caps for 'irish' names but not contractions?

howdy flyingmale,

this will do it from in the actions dialog ...

field = _TITLE
regex = (C|D|L|O)'(.{1})
replace matches with = $1'$upper($2)

you can replace the c,d,l,o with whatever letters you want or remove all but the "o". it tests for a specific letter followed an apostrophe and at least one letter.

so that ...
L'orange = L'Orange
O'dell = O'Dell
D'meer = D'Meer
C'tahr = C'Tahr

take care,

Thanks so much, Lee, that works great!

howdy flyingmale,

you are quite welcome! glad to help a little now and then ... [grin]

take care,

I've now worked out a new edit of this for Mac.. and Mc... ?

regex = (Mac)(.{1})
replace matches with = $1$upper($2)

regex = (Mc)(.{1})
replace matches with = $1$upper($2)

Thanks again

howdy flyingmale,

i don't understand what you are trying to do ... please show an example.

here are two that i use for Mac & Mc ...

field = _TAG
regex = (^|\s|(|[|')Mac([bdfgln])
replace matches = $1Mac$upper($2)

the above finds any "Mac" that is at the beginning of a word by testing for ...

  • at the beginning of the field
  • after a space
  • after a (
  • after a [
  • after a '

... and then followed by any of b-d-f-g-l-n.
other than an "a", these are the only letters i have ever seen in a "mac-whatever" name. i left out the "a" [MacArthur] since i have a surprising number of artists and titles with "maca" at the beginning of the word. really odd, that. [grin] you may want to include the "a" if your listing has more MacNames that cap the "a".

then it upper cases the letter after the "c".

Macdonald = MacDonald
Macleod = MacLeod

this one does the same beginning-of-word test and then upper cases anything after the Mc.

field = _TAG
regex = (^|\s|(|[|')Mc(.{1})
replace matches = $1Mc$upper($2)

Mcleod = McLeod
Mcduff = McDuff

is that what you are looking for?

take care,

It looks like all those problems have been solved already, see also ...
Regular Expressions
Case conversion...
... only to pick two guys out of the crowd of forum contributors.


howdy DetlevD,

thank you for those links! [grin] i knew i got those regexes from here but could not remember who from.

the OP edited his Mac/Mc post so that it no longer matches up with my response. [grin] makes for a rather weird read, now.

take care,