
Untitled
By: a guest on
May 6th, 2012 | syntax:
None | size: 0.58 KB | hits: 22 | expires: Never
Single Quote in regex issue ABAP
data text type string value `this is a string containing a ' single quote`.
find regex `('|%27)` in text.
if sy-subrc = 0.
write 'found'.
endif.
my $tofind = "'"; //a single quote
my $text = "this is a string containing a ' single quote";
if($text=~m/$tofind/){
print "found";
}
data text type string value `this is a string containing a '' single quote`.
find regex `(''|%27)` in text.
if sy-subrc = 0.
write 'found'.
endif.
SEARCH text FOR ''''.
if sy-subrc eq 0.
WRITE: 'Position:' , SY-FDPOS.
endif.