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 ??

former_member194669
Active Contributor
0 Likes
358

I am using a RegEX this way for phone numbers

'^[(]?[2-9][0-9][) -]{0,2}' . '[0-9][- ]?' . '[0-9][ ]?' . '((x|ext)[.]?[ ]?[0-9]{1,5})?$';

in


    create object regex
      exporting
        pattern     = p_regex
        ignore_case = ''.
* For REGEX match
    matcher = cl_abap_matcher=>create(
                   pattern     = p_regex
                   ignore_case = ' '
                   table       = i_files ).

but i am getting an error saying that "No ending delimiter"

Any info?

a®

2 REPLIES 2
Read only

Former Member
0 Likes
334

'^[(]?2-90-9) -{0,2}' . '0-9- ?' . '0-9[ ]?' . '((x|ext)[.]?[ ]?0-9{1,5})?$' ;

I think the last character is a ; It should be a '.'

Read only

former_member194669
Active Contributor
0 Likes
334

I missed the ending ^

Correct RegEX will be

'?[2-9][0-9][) -]{0,2}' . '[0-9][- ]?' . '[0-9][ ]?' . '((x|ext)[.]?[ ]?[0-9]{1,5})?$'

a®