12-24-2008 3:25 AM
hi,
who know how to get all digits from the string "Alerts 4520 ( 227550 ) ( 98 Available )" by regular expression, thanks
br, Andrew
12-24-2008 3:38 AM
hi,
you can use
CO = "contains only",
CA = "contains any".
CN "contains not only"
IF string CO '0123456789'
the string contains only digits
ELSE.
the string contains not only digits (could be no digits at all)
ENDIF.
thanks
12-24-2008 4:01 AM
Liu,
You can use RegEx as
d+
Whether you are using CL_ABAP_REGEX class then
report zars.
data: regex type ref to cl_abap_regex,
matcher type ref to cl_abap_matcher,
match type c length 1.
create object regex exporting pattern = 'd+'
ignore_case = ''.
matcher = regex->create_matcher( text = 'Test123tes456' ).
match = matcher->match( ).
write match
You can find more details regarding REGEX and POSIX examples here
http://www.regular-expressions.info/tutorial.html
a®