Help using Base SAS procedures

sas perl regular expression

Reply
Occasional Contributor
Posts: 8

sas perl regular expression

in perl, i can do this,
$a = "abcd1234";
print $1 if $a=~/abcd(\d+)/;

if the string is abcd1234, i try to get the number followed by abcd, the perl can automatically assign a variable that matched in the parenthsis, can SAS PRX function do this? Message was edited by: siliconcreature
Respected Advisor
Posts: 3,799

Re: sas perl regular expression

Posted in reply to siliconcreature
RTM!

[pre]
PRXPOSN Function
--------------------------------------------------------------------------------
Returns a character string that contains the value for a capture buffer.
[/pre]
Occasional Contributor
Posts: 8

Re: sas perl regular expression

Posted in reply to data_null__
that will return abcd1234, assumed
Occasional Contributor
Posts: 8

Re: sas perl regular expression

Posted in reply to siliconcreature
sorry, you are right, i missread that section. thank you.
Ask a Question
Discussion stats
  • 3 replies
  • 117 views
  • 0 likes
  • 2 in conversation