Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.58 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Single Quote in regex issue ABAP
  2. data text type string value `this is a string containing a ' single quote`.
  3.     find regex `('|%27)` in text.
  4.     if sy-subrc = 0.
  5.     write 'found'.
  6.     endif.
  7.        
  8. my $tofind = "'"; //a single quote
  9. my $text = "this is a string containing a ' single quote";
  10. if($text=~m/$tofind/){
  11. print "found";
  12. }
  13.        
  14. data text type string value `this is a string containing a '' single quote`.
  15.     find regex `(''|%27)` in text.
  16.     if sy-subrc = 0.
  17.     write 'found'.
  18.     endif.
  19.        
  20. SEARCH text FOR ''''.
  21. if sy-subrc eq 0.
  22.   WRITE: 'Position:' , SY-FDPOS.
  23. endif.