Skip to Content
0
Jun 27, 2016 at 04:22 PM

cl_abap_matcher and [[:unicode:]]

555 Views

Hello experts,

I'm having difficulty using ABAP class cl_abap_matcher with special characters. Specifically, I'm trying to find any unicode characters in a string using cl_abap_matcher with the following code:

p_instring = 'THIS IS A TEST. 你好 THIS IS ONLY A TEST.'

matcher = cl_abap_matcher=>create( pattern = '[[:unicode:]]'

text = p_instring ).

if matcher->match( ).

"match found

...

However, if I use the "find regex" version:


p_instring = 'THIS IS A TEST. 你好 THIS IS ONLY A TEST.'

find regex '[[:unicode:]]' in p_instring

this works fine.

Thanks in advance for any help!

Bruce