Salutation

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • 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.

    Quellcode

    1. %_SourceName='Mr John Doe'%-
    2. echo source name: %_SourceName%-
    3. %SetPattRegExp='((\w*)(id|hn|děk|ter))+[ ]'%-
    4. %RegExpBlindMatch='%_SourceName'%-
    5. %_Result0=%SubPatt='1'%-
    6. %_Result1=%SubPatt='2'%-
    7. %_Result2=%SubPatt='3'%-
    8. echo R0: %_Result0
    9. echo R1: %_Result1
    10. echo R2: %_Result2%-
    11. %IF:"%_Result2"='id':%_Result="ide"%-
    12. %IF:"%_Result2"='hn':%_Result="hns"%-
    13. %IF:"%_Result2"='děk':%_Result="ďku"%-
    14. %IF:"%_Result2"='ter':%_Result="tere"%-
    15. %IF:"%_Result2"='':%_Name="%_SourceName":%_Name="%_Result1%-%_Result"%-
    16. 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


    Quellcode

    1. %_SourceName='Mr John'%-
    2. echo source name: %_SourceName
    3. %SetPattRegExp='(\s+(.*).*(hn)$)'%-
    4. %RegExpBlindMatch='%_SourceName'%-
    5. 0 %SubPatt='1'
    6. 1 %SubPatt='1'
    7. 2 %SubPatt='2'
    8. 3 %SubPatt='3'
    Alles anzeigen

    Sorry for little english.

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von truefriend-cz ()

  • You need somebody who is good at RegExp. Maybe you can find something yourself:
    There is also a PDF tutorial for TB! users in both German and English (47 pages). Maybe you can find it on the Internet:

    Quellcode

    1. ENGLISH:
    2. How to Use Regular Expressions
    3. An Introduction into Regular Expressions
    4. A Tutorial for TheBat!-Users
    5. by
    6. Gerd Ewald (Author)
    7. and
    8. Marck D. Pearlstone (Editor)
    9. GERMAN:
    10. Reguläre Ausdrücke
    11. Eine allgemeine Einführung in die Benutzung regulärer Ausdrücke
    12. Ein Kurs (nicht nur) für Anwender des Mailprogramms TheBat!
    13. © Gerd Ewald, Ratingen 2002-2010
    Alles anzeigen