Hello TBTech list recipients,
Due to one (a bit complicated) Serbian grammatical rule, I need one, or
group of regexps, that will usually strip the last character in the first
name and add some modifications.
Please read this on, it's not that difficult.
Firstly, what is the general regexp pattern that will strip out last
character in the name?
e.g. convert "iVan" to "iVa", or "s0me_b0dY" to "s0me_b0d"?
________________________
... 1 ...
Every name that ends on 'N', 'V', 'R', 'S', 'B' 'T', 'L', 'D', 'M' and 'P'
letter (case insensitive); when we reply, we must end it with 'ne', 've',
're', 'se', 'be', 'te', 'le', 'de', 'me' and 'pe' respectively... (we just
add 'e').
Examples:
[n] Ivan -> Ivane (e.g., serb. intro: "Hello Ivan!" -> "Zdravo Ivane!")
Dragan -> Dragane
Dejan -> Dejane
...
[v] Dragoslav -> Dragoslave
Miroslav -> Miroslave
...
[r]* Svetozar -> Svetozare
Vladimir -> Vladimire
...
[s] Boris -> Borise
...
[b] Rodoljub -> Rodoljube
...
[t] Robert -> Roberte
...
[l] Danijel -> Danijele
...
[d] Milorad -> Milorade
...
[m] Naum -> Naume
...
[p] Filip -> Filipe
...
* The only exceptions here with 'r' are:
Aleksandar -> Aleksandre
Petar -> Petre
Mitar -> Mitre
... so, if ends with 'dar' and 'tar', we must turn it to 'dre' and 'tre'.
I can use %OFromFName%-e construct, but not all Serbian names end with 'n',
'r', 's' etc.
So, regexp task #1:
"Detect first name, and if it ends with 'n' or 'v' or 'r' or 's' or 'b' or
't' or 'l' or 'd' or 'm' or 'p', go and use %OFromFName%-e construct, but
bear in mind that there are exceptions with 'r'; turn 'dar' and 'tar' into
'dre' and 'tre'."
... 2 ...
Example:
Ljubica -> Ljubice
Milica -> Milice
Zorica -> Zorice
...
Regexp task #2: "If first name ends with 'ca', strip that off and change to
'ce'."
... 3 ...
Example:
Predrag -> Predraze
Miodrag -> Miodraze
Ljubodrag -> Ljubodraze
...
Regexp task #3: "If first name ends with 'g', strip that off and change to
'ze'."
... 4 ...
Example:
Vuk -> Vuce
...
Regexp task #4: "If first name ends with 'k', strip that off and change to
'ce'."
________________________
Thank you very much in advance, you will really help me a lot!
--
Sincerely,
Ivan Lisac
Using The Bat! v1.53d under Windows NT 4.0 Build 1381 Service Pack 6
--
______________________________________________________
Archives : http://tbtech.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]