*---------------------------------------------------------------------* * DECLARATIONS * *---------------------------------------------------------------------* DATA: go_matcher TYPE REF TO cl_abap_matcher. *---------------------------------------------------------------------* * LAYOUT * *---------------------------------------------------------------------* PARAMETERS: pa_mail TYPE AD_SMTPADR. *---------------------------------------------------------------------* * EVENTS * *---------------------------------------------------------------------* AT SELECTION-SCREEN. IF pa_mail IS NOT INITIAL. go_matcher = cl_abap_matcher=>create( pattern = '\w+(\.\w+)*@(\w+\.)+(\w{2,4})' ignore_case = 'X' text = pa_mail ). IF go_matcher->match( ) IS INITIAL. MESSAGE 'Invalid Mail Address' TYPE 'E'. ENDIF. ENDIF.
giovedì 6 novembre 2014
Espressioni regolari
Iscriviti a:
Commenti sul post (Atom)
Nessun commento:
Posta un commento