input string $ 50.;
cards;
THIS LINE DOES NOT HAVE ANY PHONE NUMBERS ON IT
THIS LINE DOES: (123)345-4567 LA DI LA DI LA
ALSO VALID (123) 999-9999
TWO NUMBERS HERE (333)444-5555 AND (800)123-4567
;
run;
data b;
set a;
per=prxparse("/\(\d{3}\) ?\d{3}-\d{4}/");
retain per;
if prxmatch(per,string) then do;
call prxsubstr(per,string,start,length);
b=substr(string,start,length);
b=compress(b," ");
output;
end;
run;



雷达卡



京公网安备 11010802022788号







