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

Help required in an expression

Former Member
0 Likes
417

Hi All,

I have a expression " ^(.)(\d)(あ|い|う|え|お|か|き|く|け|こ|わ|れ)(\d*)$ " in Visual Basic.

Please help me how to perform this in ABAP. It would be helpful, if any function module is available for the above expression.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
391

Try this way


 move '^(.*)(d*)(u3042|u3044|u3046|u3048|u304A|u304B|u304D|u304F|u3051|u3053|u308F|u308C)(d*)$' to p_regex.
    condense p_regex.
    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 ).
 
    lt_result = matcher->replace_all( ).

But i am not sure how this will work in Unicode environment, ie these above said chinese characters

Hi All,

I have a expression " ^(.)(\d)(あ|い|う|え|お|か|き|く|け|こ|わ|れ)(\d*)$ " in Visual Basic.

Please help me how to perform this in ABAP. It would be helpful, if any function module is available for the above expression.

1 REPLY 1
Read only

former_member194669
Active Contributor
0 Likes
392

Try this way


 move '^(.*)(d*)(u3042|u3044|u3046|u3048|u304A|u304B|u304D|u304F|u3051|u3053|u308F|u308C)(d*)$' to p_regex.
    condense p_regex.
    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 ).
 
    lt_result = matcher->replace_all( ).

But i am not sure how this will work in Unicode environment, ie these above said chinese characters