Functions and CALL Routines |
Category: | Character String Matching |
Restriction: | Use with the CALL PRXCHANGE, CALL PRXFREE, CALL PRXNEXT, CALL PRXPOSN, CALL PRXSUBSTR, PRXPARSE, PRXPAREN, and PRXMATCH functions and CALL routines. The PRXPARSE function is not DBCS compatible. |
Syntax | |
Arguments | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
CALL PRXDEBUG (on-off); |
specifies a numeric constant, variable, or expression. If the value of on-off is positive and non-zero, then debugging is turned on. If the value of on-off is zero, then debugging is turned off.
Details |
The CALL PRXDEBUG routine provides information about how a Perl regular expression is compiled, and about which steps are taken when a pattern is matched to a character value.
You can turn debugging on and off multiple times in your program if you want to see debugging output for particular Perl regular expression function calls.
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 produces debugging output.
data _null_; /* Turn the debugging option on. */ call prxdebug(1); putlog 'PRXPARSE: '; re = prxparse('/[bc]d(ef*g)+h[ij]k$/'); putlog 'PRXMATCH: '; pos = prxmatch(re, 'abcdefg_gh_'); /* Turn the debugging option off. */ call prxdebug(0); run;
The following lines are written to the SAS log.
SAS Log Results from CALL PRXDEBUG
PRXPARSE: Compiling REx '[bc]d(ef*g)+h[ij]k$' 1 size 41 first at 1 2 rarest char g at 0 5 rarest char d at 0 1: ANYOF[bc](10) 3 10: EXACT <d>(12) 12: CURLYX[0] {1,32767}(26) 14: OPEN1(16) 16: EXACT <e>(18) 18: STAR(21) 19: EXACT <f>(0) 21: EXACT <g>(23) 23: CLOSE1(25) 25: WHILEM[1/1](0) 26: NOTHING(27) 27: EXACT <h>(29) 29: ANYOF[ij](38) 38: EXACT <k>(40) 40: EOL(41) 41: END(0) anchored 'de' at 1 floating 'gh' at 3..2147483647 (checking floating) 4 stclass 'ANYOF[bc]' minlen 7 6 4 PRXMATCH: Guessing start of match, REx '[bc]d(ef*g)+h[ij]k$' against 'abcdefg_gh_'... Did not find floating substr 'gh'... Match rejected by optimizer
The following items correspond to the lines that are numbered in the SAS log that is shown above.
See Also |
|
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.