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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.