I want to extract year (4 digits) from a string which alphanumeric. The location of the year varies.
The field name is 'Preclinical' that holds the string. Typical example of the string is
"In SHR, po doses of 1-10mg/kg produced an antihypertensive effect of gradual onset and sustained (>7hr) duration due to peripheral vasodilation. It also showed suppression of the pressor response to cold stress, due to presynaptic action on the sympathetic nerve (Company communication, Fujirebio, Mar 1995). Tachycardia and cardiac depression side-effects were weaker cf nifedipine."
I want to extract 1995 from the string to precdate2. I tried the following code. But I am not any values in the output field precdate2.
prx = prxparse("/(\s)(\d\d\d\d)(\s)/"); if prxmatch(prx, Preclinical) then do; precdate2 = prxposn(prx, 4, Preclinical); end;
... View more