Search notes:

SAS programming, function prxmatch

prxmatch: find a regular expression pattern.
%macro containsDigit(txt);
/*     Check if txt contains at least one digit */

   %local pos;
   %let   pos = %sysfunc(prxmatch(/\d/, &txt));

/* The value of pos indicates the position of the first
   character that matches. If the pattern does not match,
   pos will be 0 */

   %if &pos > 0
   %then %put &txt contains a digit at position &pos;
   %else %put &txt does not contain a digit;


%mend  containsDigit;


%containsDigit(foo bar baz) /* foo bar baz does not contain a digit    */
%containsDigit(I say 42)    /* I say 42 contains a digit at position 7 */
Github repository about-SAS, path: /programming/functions/prxmatch/containsDigit.sas

See also

prxchange
functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Companie...', 1758199681, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/functions/prxmatch/index(63): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78