Functions and CALL Routines |
Perl regular expressions are supported beginning with SAS®9.
The PRX functions use a modified version of Perl 5.6.1 to perform regular expression compilation and matching. Perl is compiled into a library for use with SAS. This library is shipped with SAS®9. The modified and original Perl 5.6.1 files are freely available in a ZIP file from http://support.sas.com/rnd/base. The ZIP file is provided to comply with the Perl Artistic License and is not required in order to use the PRX functions. Each of the modified files has a comment block at the top of the file describing how and when the file was changed. The executables were given nonstandard Perl names. The standard version of Perl can be obtained from http://www.perl.com.
Only Perl regular expressions are accessible from the PRX functions. Other parts of the Perl language are not accessible. The modified version of Perl regular expressions does not support the following items:
Perl variables (except the capture buffer variables $1 - $n, which are supported).
The regular expression options /c and /g, and the /e option with substitutions.
The regular expression option /o in SAS 9.0. (It is supported in SAS 9.1 and later.)
Executing Perl code within a regular expression, which includes the syntax (?{code}), (??{code}), and (?p{code}).
Using ?PATTERN?. ? is treated like an ordinary regular expression start and end delimiter.
Perl comments between a pattern and replacement text. For example: s{regexp} # perl comment {replacement} is not supported.
Matching backslashes with m/\\\\/. Instead use m/\\/ to match a backslash.
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.