/*Regular Expression Definition*/
/*1st Capturing Group (^[A-Za-z])*/
/*^ asserts position at start of a line*/
/*Match a single character present in the list below [A-Za-z]*/
/*+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed */
/*a-z matches a single character in the range between a and z */
/*2nd Capturing Group ([0-9])*/
/*Match a single character present in the list below [0-9]*/
/*+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed */
/*0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) */
/*3rd Capturing Group ([A-Za-z])*/
/*Match a single character present in the list below [A-Za-z]*/
/*+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed */
/*a-z matches a single character in the range between a and z */
data want;
str="MESSAGE7676ASFD";
str_new=prxchange("s/(^[a-z]+)([0-9]+)([a-z]+)/$1 $2 $3/io",-1,str);
put (_all_) (=);
run;
40 data want;
41 str="MESSAGE7676ASFD";
42 str_new=prxchange("s/(^[a-z]+)([0-9]+)([a-z]+)/$1 $2 $3/io",-1,str);
43
44 put (_all_) (=);
45 run;
str=MESSAGE7676ASFD str_new=MESSAGE 7676 ASFD
... View more