Hi Experts,
some of the praxmatch are not working for some regular expressions.
Could you please tell me whats wrong with the regular expressions where it is not working.
data test;
input StudyEventKey:$40.;
x = prxmatch(prxparse('/^VIST\[*\]*V*\[*\]/') ,StudyEventKey); /*Does not work*/
x1 = prxmatch(prxparse('/^VIST\[*\]*V*\[1\]/') ,StudyEventKey);
x2 = prxmatch(prxparse('/^VIST\[*\]*V*\[2\]/') ,StudyEventKey);
y = prxmatch(prxparse('/^VIST\[*\]*V*/') ,StudyEventKey);
z = prxmatch(prxparse('/^VIST\[*\]\/*V*\[*\]/') ,StudyEventKey); /*Does not work*/
cards;
VIST[1]/FV[1]
VIST[1]/SV[1]
VIST[1]/TV[1]
VIST[2]/FV[1]
VIST[2]/SV[1]
VIST[2]/TV[1]
;
run;
Hey @Satish_Parida
The First Statement doesn't work because you are looking for the word VISIT then for 0 to n occurences of [ that is probabely not the intended effect.
Something like ^VIST\[\d\]*V*\[*\] would to the trick here.
I highly recommend using https://regexr.com/38ed7 to built your regex.
Kind regards
Criptic
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.