Thanks a lot un_pogaz
your regex is smart and works !!
I was too newbie in regex to think this way so this answer was also a good teaching.

)
Quote:
Originally Posted by un_pogaz
Chalut
To switch "Lastname,Firstname" to "Firstname Lastname", it's strangely easier than you think. A simple "([^,&]+),([^,&]+)" => "\2 \1" is enough.
For "Bloodthorne,Ralts & Lastname,Firstname", the result will be "Ralts Bloodthorne&Firstname Lastname" (Calibre will automatically transform it into a valid format "Ralts Bloodthorne & Firstname Lastname"). No need to worry about the ampersand, it seems to work.
And if you haven't already done, I advise you to use the Mass Search/Replace plugin which will allow you to quickly launch various saved operations.
Français:
Spoiler:
Pour intervertir "Nom,Prénon" vers "Prénom Nom", s'est bizarrement plus simple qu'on ne le croit. Un simple "([^,&]+),([^,&]+)" => "\2 \1" suffit.
Pour "Bloodthorne,Ralts & Nom,Prénon", le résultat sera "Ralts Bloodthorne&Prénom Nom" (Calibre le transformera automatiquement en format valide "Ralts Bloodthorne & Prénon Nom"). Pas besoin de s'occuper de l'éperluette, apparemment ça passe.
Et si s'est pas déjà fait je te conseil le plugin Mass Search/Replace qui te permettra de lancé rapidement diverse opérations sauvegardé.
|