Code
Output
*&---------------------------------------------------------------------* *& Report ZEMAIL *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZEMAIL. DATA: go_regex TYPE REF TO cl_abap_regex, go_matcher TYPE REF TO cl_abap_matcher, go_match TYPE c LENGTH 1, gv_msg TYPE string. PARAMETERS: p_email TYPE ad_smtpadr. START-OF-SELECTION. CREATE OBJECT go_regex EXPORTING pattern = '\w+(\.\w+)*@(\w+\.)+(\w{2,4})' ignore_case = abap_true. go_matcher = go_regex->create_matcher( text = p_email ). IF go_matcher->match( ) IS INITIAL. gv_msg = 'Email address is invalid'. ELSE. gv_msg = 'Email address is valid'. ENDIF. MESSAGE gv_msg TYPE 'I'. |
Output
Previous Page |
Next Page |
No comments:
Post a Comment
Note: only a member of this blog may post a comment.