I would like to extract serum creatinine values from these strings. My regular expression does not work. How can I fix it? data _NULL_;
str1 = 'Serum creatinine: 3160'; * WANT: 3160;
str2 = 'Serum creatinine is 3160'; * WANT: 3160;
str3 = '72(ref range 44-106)'; *WANT: 72 and 44-106;
str4 = '133 H umol/l (49-93)'; *WANT: 133 and 49-93;
str5 = '80(Ref. Int. 52-112 umol/L)'; *WANT: 80 and 52-112;
str6 = 'TEST RESULT\.br\COLLECTION DATE 6-FEB-2014\.br\24 HOUR URINE VOLUME 0.100\.br\\.br\SERUM CREATININE LEVEL 511 HI 64 - 110'; *WANT: 511 and 64-110;
reg_ex = prxparse("/((?:.*?)(?=CREATININE)?(?:.*?))\s*(\d+)\s*(\d+\s*-\s*\d+)?/oi");
reg_match = prxmatch(reg_ex, str2);
paren = prxparen(reg_ex);
put paren=;
run;
... View more