In version 9, the SAS® System introduces Perl regular expressions (sometimes known by the acronym PRX, the first three letters of these functions or call routines). However, previous versions of SAS® already had regular expressions (known by their acronym RX, the first two letters of these functions or call routines). This presentation will describe specific functional and performance differences in these two exclusive regular expression strategies, and offer recommendations on when to use each strategy. The technologies will be compared using SAS Enterprise Guide® 4.3.
No-1 Call Girls In Goa 93193 VIP 73153 Escort service In North Goa Panaji, Ca...
Regular Expressions in SAS Enterprise Guide
1. Regular Expressions in SAS®
Enterprise Guide®
Mark Tabladillo Ph.D.
http://www.marktab.com
@marktabnet
2. Introduction
Regular expressions are the foundation of character
pattern matching
Textual data is increasingly important in predictive
analytics
SAS Enterprise Guide® offers regular expression
processing
3. Outline
Guide for Migrating from SAS (RX) expressions to Perl
(PRX) regular expressions
Best practices for Perl Regular Expressions
Advanced Perl Regular Expression Capabilities
Demo
4. How to Migrate from SAS(RX) to Perl
(PRX) Regular Expressions
5. Upgrade to Perl (PRX) Regular Expressions
SAS (RX) Perl (PRX) Description
RXPARSE PRXPARSE Compiles a regular expression (RX or PRX) that can be used
Function Function for pattern matching of a character value
RXMATCH PRXMATCH Searches for a pattern match and returns the position at which
Function Function the pattern is found
CALL CALL Returns the position and length of a substring that matches a
RXSUBSTR PRXSUBSTR pattern (RX includes score)
Routine Routine
CALL CALL Performs a pattern-matching replacement
RXCHANGE PRXCHANGE
Routine Routine
PRXCHANGE
Function
CALL RXFREE CALL PRXFREE Frees unneeded memory allocated for a regular expression
Routine Routine (either RX or PRX)
7. Categories of Regular Expression
Commands
Category Single-Line Proc SQL Data Step Macro
Command
Accepts Perl YES YES YES YES
Regular
Expression
Accepts no YES YES YES
Regular
Expression ID
Has CALL no no YES YES
Routine
Variant
8. Regular Expression Commands (1 of 3)
Description Accepts Perl Accepts Regular Has a Call
Command Regular Expression ID Routine Variant
Expression
PRXCHANGE Performs a pattern- YES YES YES
matching replacement.
PRXDEBUG Enables Perl regular no no YES
expressions in a DATA
step to send debugging
output to the SAS log.
PRXFREE Frees memory that was no no YES
allocated for a Perl
regular expression.
9. Regular Expression Commands (2 of 3)
Description Accepts Perl Accepts Regular Has a Call
Command Regular Expression ID Routine Variant
Expression
PRXMATCH Searches for a pattern YES YES no
match and returns the
position at which the
pattern is found.
PRXNEXT Returns the position no no YES
and length of a
substring that matches
a pattern, and iterates
over multiple matches
within one string.
PRXPAREN Returns the last bracket no YES no
match for which there is
a match in a pattern.
10. Regular Expression Commands (3 of 3)
Description Accepts Perl Accepts Regular Has a Call
Command Regular Expression ID Routine Variant
Expression
PRXPARSE Compiles a Perl regular YES no no
expression (PRX) that
can be used for pattern
matching of a character
value.
PRXPOSN Returns a character no YES YES
string that contains the
value for a capture
buffer.
PRXSUBSTR Returns the position no no YES
and length of a
substring that matches
a pattern.
12. Commands
Description
Perl (PRX)
CALL PRXPOSN Returns the start position and length for a capture buffer
Routine
PRXPOSN Function Returns the value for a capture buffer
PRXPAREN Function Returns the last bracket match for which there is a match
in a pattern
CALL PRXNEXT Returns the position and length of a substring that
Routine matches a pattern and iterates over multiple matches
within one string
CALL PRXDEBUG Enables Perl regular expressions in a DATA step to send
Routine debug output to the SAS log
14. Conclusion
See the Paper for Details
Guide for Migrating from SAS (RX) expressions to Perl (PRX)
regular expressions
Best practices for Perl Regular Expressions
Advanced Perl Regular Expression Capabilities
Demo
Contact
http://www.marktab.com
http://www.marktab.net
@marktabnet
15. Abstract
In version 9, the SAS® System introduces Perl regular
expressions (sometimes known by the acronym PRX,
the first three letters of these functions or call routines).
However, previous versions of SAS® already had
regular expressions (known by their acronym RX, the
first two letters of these functions or call routines). This
presentation will describe specific functional and
performance differences in these two exclusive regular
expression strategies, and offer recommendations on
when to use each strategy. The technologies will be
compared using SAS Enterprise Guide® 4.3.