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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.