Previous Page | Next Page

Functions and CALL Routines

PRXPAREN Function



Returns the last bracket match for which there is a match in a pattern.
Category: Character String Matching
Restriction: Use with the PRXPARSE function.

Syntax
Arguments
Details
Comparisons
Examples
See Also

Syntax

PRXPAREN (regular-expression-id)


Arguments

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

Functions and CALL routines:

CALL PRXCHANGE Routine

CALL PRXDEBUG Routine

CALL PRXFREE Routine

CALL PRXNEXT Routine

CALL PRXPOSN Routine

CALL PRXSUBSTR Routine

CALL PRXCHANGE Routine

PRXCHANGE Function

PRXMATCH Function

PRXPARSE Function

PRXPOSN Function

Previous Page | Next Page | Top of Page