Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

REGEX pattern problem

Former Member
0 Likes
2,259

Hello guys, I need to make validation on a variable that contains only letters, digits, space and dot. I use pattern like the one below, but I receive error

Regular expression '[^A-Za-z0-9-\s\.]' is invalid in character position 13 (\s)

Any hits will be wellcome

REPLACE ALL OCCURRENCES OF REGEX '[^A-Za-z0-9-\s\.]' IN lv_name1 WITH ''.
1 ACCEPTED SOLUTION
Read only

NTeunckens
Active Contributor
1,500

You can test the RegEx in the SAP-prgr "DEMO_REGEX_TOY" ...

You will find that your RegEx is invalid, but a (quick and possibly not all-couvering) solution could be :

REPLACE ALL OCCURRENCES OF REGEX '[^a-zA-Z0-9\s\.].' IN lv_name1 WITH ''.
1 REPLY 1
Read only

NTeunckens
Active Contributor
1,501

You can test the RegEx in the SAP-prgr "DEMO_REGEX_TOY" ...

You will find that your RegEx is invalid, but a (quick and possibly not all-couvering) solution could be :

REPLACE ALL OCCURRENCES OF REGEX '[^a-zA-Z0-9\s\.].' IN lv_name1 WITH ''.