Hi. Sorry for english language. I dont Germany sprachen. English little. Ok.
I have problem. I have macro for salutation or i dont RegEx expert.
%_SourceName='Mr John Doe'%-
echo source name: %_SourceName%-
%SetPattRegExp='((\w*)(id|hn|děk|ter))+[ ]'%-
%RegExpBlindMatch='%_SourceName'%-
%_Result0=%SubPatt='1'%-
%_Result1=%SubPatt='2'%-
%_Result2=%SubPatt='3'%-
echo R0: %_Result0
echo R1: %_Result1
echo R2: %_Result2%-
%IF:"%_Result2"='id':%_Result="ide"%-
%IF:"%_Result2"='hn':%_Result="hns"%-
%IF:"%_Result2"='děk':%_Result="ďku"%-
%IF:"%_Result2"='ter':%_Result="tere"%-
%IF:"%_Result2"='':%_Name="%_SourceName":%_Name="%_Result1%-%_Result"%-
echo Name: Dear %_Name,
Alles anzeigen
This is testing version for public, or if change SourceName to function for get sender then ok.
Script matching base format name and if extension name is id, hn, děk, etc. then replace to extension by table.
But, problem is: i must use two database. I dont expert in RegEx but i have question:..
I want to ask if anyone could help me to rewrite the suffix of a name using a regex with one database and not use the conversion table.
From what I've been studying for RegEx, it should be addressed by the so-called RegEx Groups. But I do not know what the proper format to use for this feature. What I'm trying to test is closest to this format using RegEx Groups. But I'm still unable to get there. Please, can anyone help me? Thanks
%_SourceName='Mr John'%-
echo source name: %_SourceName
%SetPattRegExp='(\s+(.*).*(hn)$)'%-
%RegExpBlindMatch='%_SourceName'%-
0 %SubPatt='1'
1 %SubPatt='1'
2 %SubPatt='2'
3 %SubPatt='3'
Alles anzeigen
Sorry for little english.