|
The search and extract section of the tip sheet confirm this:
http://support.sas.com/rnd/base/topics/datastep/perl_regexp/regexp-tip-s
heet.pdf
as do the examples here:
http://support.sas.com/rnd/base/topics/datastep/perl_regexp/regexp.motiv
ation.html#Examples
hth
Paul Choate
DDS Data Extraction
(916) 654-2160
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Alan
> Churchill
> Sent: Monday, June 19, 2006 9:54 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Do regular expressions need to be declared in _n_=1
>
> All,
>
> I seem to recall at the last SUGI that regular expression patterns are
> automatically retained and are only processed once in a data step. For
> example,
>
> Old Way:
>
> Data test ;
> Infile 'something or other' ;
> Input;
> Retain pattern ;
> If _n_ = 1 then
> Do ;
> Pattern = prxparse("/some regex/") ;
> End;
> Run ;
>
>
> Optional way:
>
> Data test ;
> Infile 'something or other' ;
> Input;
> Pattern = prxparse("/some regex/") ;
> Run ;
>
>
> Can anyone confirm this?
>
> Thanks,
> Alan
>
> Alan Churchill
> Savian "Bridging SAS and Microsoft Technologies"
> www.savian.net
|