Could someone kindly tell me what this regular expression "(prxmatch(/[#]/,&path.))=0" means?
%if %sysfunc(prxmatch(/[#]/,&path.))=0 %then %do;
with a concrete case will be better.thank you for your time
Hello,
I would say that the square brackets here are useless and the regex is only used to
test whether the path macrovariable contains a hash sign.
234 %macro regexp(path);
235 %if %sysfunc(prxmatch(/[#]/,&path.))=0 %then %do;
236 %put OK;
237 %end;
238 %else %do;
239 %put KO;
240 %end;
241 %mend;
242
243 %regexp(c:/temp);
OK
244 %regexp(c:/temp/file#1);
KO
[list of characters] matches any character in the list.
Hello,
I would say that the square brackets here are useless and the regex is only used to
test whether the path macrovariable contains a hash sign.
234 %macro regexp(path);
235 %if %sysfunc(prxmatch(/[#]/,&path.))=0 %then %do;
236 %put OK;
237 %end;
238 %else %do;
239 %put KO;
240 %end;
241 %mend;
242
243 %regexp(c:/temp);
OK
244 %regexp(c:/temp/file#1);
KO
[list of characters] matches any character in the list.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.