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

Check for Unicode Categories

otto_boehrer
Advisor
Advisor
0 Likes
713

Hi,

what I am trying to do is to check in ABAP a given URL for characters from certain UC categories.

For example, I want to check if an input characters belongs to category [L], which is actually consisting of the (sub) categories Ll, Lm, Lo, Lt and Lu.

There are thousands of characters in these categories.

In Perl, for example, a regex for checking for a lower case letter would simply look like this \p{Ll}, but that does no work in ABAP regex.

Does anyone had such a problem before or even a solution for this in ABAP?

Thanks, Otto

Hi,

what I am trying to do is to check in ABAP a given URL for characters from certain UC categories.

For example, I want to check if an input characters belongs to category [L], which is actually consisting of the (sub) categories Ll, Lm, Lo, Lt and Lu.

There are thousands of characters in these categories.

In Perl, for example, a regex for checking for a lower case letter would simply look like this \p{Ll}, but that does no work in ABAP regex.

Does anyone had such a problem before or even a solution for this in ABAP?

Thanks, Otto

1 REPLY 1
Read only

otto_boehrer
Advisor
Advisor
0 Likes
642

The only current solution in ABAP is to use the static method cl_icu_character=>get_property_value.

Input:

im_c = <character>

im_property = 'General_Category'

Output:

ex_value = 'Lowercase_Letter' , 'Uppercase_Letter' , 'Titelcase_Letter' , etc.

You may map the returned string to a "Perl-like" category name.

Example:

Lowercase_Letter -> Ll

Uppercase_Letter -> Lu

Titlecase_Letter -> Lt

etc.