2024 Dec 12 11:21 AM
Hello Experts,
Please help me with the PCRE regular expression to validate that semi-colons have separated a string of emails.
Thank you!
2024 Dec 16 3:44 PM
Hi Experts,
Thanks for your consideration. I'm happy I found a solution to my question. I will share the findings with a practical example.
Data: lv_email_str type string,
lv_regex type string.
lv_email_str = `johndoe@gmail.com; kimteddy@yahoo.com; maria_stella@outlook.com`.
lv_regex = `(?!.*;$)^([-\w]+?@\w+\.\w+(?:\s*;\s*)?)+$`.
IF matches( val = lv_email_str pcre = lv_regex ).
****True****
ELSE.
****False****
ENDIF.
Note: The only special character allowed here besides @, is the semi-colon and only as a separator between emails.
Hi Experts, Thank you for your consideration. I’m pleased to have found a solution to my question. I will share my findings with a practical example.