Created
May 3, 2022 21:59
-
-
Save lopezpappalardo/89147b410d2e6c74ebd007e3525bf9f7 to your computer and use it in GitHub Desktop.
Validar dirección de email en ABAP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATA: lo_matcher TYPE REF TO cl_abap_matcher, | |
lv_email TYPE string. | |
lv_email = 'consultor@lopezpappalardo.xyz'. | |
lo_matcher = cl_abap_matcher=>create( | |
pattern = '^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$' | |
text = lv_email ). | |
IF lo_matcher->match( ) IS INITIAL. | |
" Mail no válido | |
ELSE. | |
" Mail válido | |
ENDIF. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment