Hi everyone,
I've a a load of photographs of people that I want to associate with their email addresses.
The file names are in the format [Firstname] [Lastname].jpg
and their email address is in the format: [Firstinitial][Lastname]@domain.co.uk
So far, I've got the following regex that turns their first name into a first initial, removes the space, and adds their lastname:
Match: ^([A-Z])([a-z]*) ([A-Z][a-z]*)
Replace: \1\3
and combine this with the @domain.co.uk suffix.
This appears to work fine for people like John Smith or Jane Simpson, however, some people have more complicated names.
If there is someone with a name like Anton Du Chocolat, it ends upasADu@domain.co.uk.
I've even got someone with a name like this: Jean-Luc De Pompier.
I was wondering if anyone has any insight as to how I might deal with more complicated names like this?
Any help you can offer would be greatly appreciated.