Hi @AllanBowe, Is this what you were looking for? 28 data _null_; 29 /* have=prxchange('s/a|g|f/$1aa$2gg$3ff/',-1,'sasgf');*/ 30 /* put have=;*/ 31 put 'want=saasggff'; 32 have=prxchange('s/(a|g|f){1}?/$1$1/',-1,'sasgf'); 33 put have=; 34 run; want=saasggff have=saasggff 36 data _null_; 37 /*have=prxchange('s/a|g|f/$1xx$2yy$3zz/',-1,'sasgf');*/ 38 /*put have=;*/ 39 put 'want=sxxsyyzz'; 40 have=prxchange('s/([^agf]*)(a){1}?([^agf]*)(g){1}?([^agf]*)(f){1}?/$1xx$3yy$5zz/',-1,'sasgf'); 41 put have=; 42 run; want=sxxsyyzz have=sxxsyyzz The former prxchange works, but only if you want to duplicate specific characters in an input string. But I guess that's not exactly what you were after... The latter prxchange should be closer to meet your requirements. So the $64k question is: does it?
... View more