Functions and CALL Routines |
Category: | Character String Matching |
Restriction: | Use with the PRXPARSE function. |
Syntax | |
Arguments | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
PRXPAREN (regular-expression-id) |
specifies a numeric variable with a value that is an identification number that is returned by the PRXPARSE function.
Details |
The PRXPAREN function is useful in finding the largest capture-buffer number that can be passed to the CALL PRXPOSN routine, or in identifying which part of a pattern matched.
For more information about pattern matching, see Pattern Matching Using Perl Regular Expressions (PRX).
Comparisons |
The Perl regular expression (PRX) functions and CALL routines work together to manipulate strings that match patterns. To see a list and short description of these functions and CALL routines, see the Character String Matching category in Functions and CALL Routines by Category.
Examples |
The following example uses Perl regular expressions and writes the results to the SAS log.
data _null_; ExpressionID = prxparse('/(magazine)|(book)|(newspaper)/'); position = prxmatch(ExpressionID, 'find book here'); if position then paren = prxparen(ExpressionID); put 'Matched paren ' paren; position = prxmatch(ExpressionID, 'find magazine here'); if position then paren = prxparen(ExpressionID); put 'Matched paren ' paren; position = prxmatch(ExpressionID, 'find newspaper here'); if position then paren = prxparen(ExpressionID); put 'Matched paren ' paren; run;
The following lines are written to the SAS log:
Matched paren 2 Matched paren 1 Matched paren 3
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.