Advertisement
NAVAPAT_T

ABAP : regular expression

Dec 5th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 0.56 KB | None | 0 0
  1. DATA : lv_string(20) VALUE 'ฟหกMK06MSTO1711-333ฟหก',
  2.        count TYPE i,
  3.        char_1.
  4.  
  5. do strlen( lv_string ) times.
  6.     count = sy-index - 1.
  7.     char_1 = lv_string+count(1).
  8. *    FIND REGEX '[0-9a-zA-Z-]' IN char_1. " in
  9.     FIND REGEX '[^0-9a-zA-Z-]' IN char_1. " not in
  10.     IF sy-subrc = 0.
  11.         WRITE  char_1.
  12.     ENDIF.
  13. ENDDO.
  14.  
  15. FIND ALL OCCURRENCES OF
  16.   REGEX '[^0-9a-zA-Z-]' IN 'ฟหกMK06MSTO1711-333ฟหก' " if no char in ENG catain it will be print pass
  17.   MATCH COUNT sy-tabix.
  18. IF sy-subrc = 0.
  19.     WRITE / 'pass'.
  20. ENDIF.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement