Hi everyone
@Ksharp gave a great solusion to the probelm of extracting a sentence with keyword from a text:
data want;
set have;
pid=prxparse('/([^\.]|\.(?=\d))+\./o');
start=1;stop=length(string);
call prxnext(pid,start,stop,string,p,l);
do while(p>0);
found=substr(string,p,l);
if find(found,'keyword','i') then output;
call prxnext(pid,start,stop,string,p,l);
end;
run;
Out of interest, anyinw can suggest modification to this code to also extract the sentence before the one that containes the keyword?
Thanks