I am currently taking advanced programming course in SAS. When I did the demo problem(course 3, demo-p302d04), I am confused about the comprehension about the PRXMATCH function. I know the prxmatch is to search the first position of the character. But I cannot make sense the output table responding to the code created. Can you please help me to learn how to comprehend the result following? Thanks so much!
Loc=prxmatch('/([2-9]\d\d)-([2-9]\d\d)-(\d{4})/',Phone);
PRXMATCH returns the beginning position of a substring that matches your regular expression. [2-9] for example matches any digit between 2 and 9, \d matches any digit, a dash matches a dash. Parentheses are used to delimit sub matches that can be extracted with the function PRXPOSN, once a match is found with PRXMATCH.
Search the web - there are plenty of tutorials about regular expressions and their use.
PRXMATCH returns the beginning position of a substring that matches your regular expression. [2-9] for example matches any digit between 2 and 9, \d matches any digit, a dash matches a dash. Parentheses are used to delimit sub matches that can be extracted with the function PRXPOSN, once a match is found with PRXMATCH.
Search the web - there are plenty of tutorials about regular expressions and their use.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.