LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (August 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 23 Aug 2011 14:20:54 -0500
Reply-To:   "Data _null_;" <iebupdte@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Data _null_;" <iebupdte@GMAIL.COM>
Subject:   Re: Regular expression repetition factor {n,m}
Comments:   To: Mike Rhoads <RHOADSM1@westat.com>
In-Reply-To:   <D47ACC3DC1D6CA4D85DE61DC39DA319F062F32F4@EX10MAIL2.westat.com>
Content-Type:   text/plain; charset=ISO-8859-1

Don't you need to be using PrxParse

data _null_; rx = prxparse("/\d+/"); rx = prxparse("/\d*/"); rx = prxparse("/\d{3}/"); rx = prxparse("/\d{1,3}/"); run;

On Tue, Aug 23, 2011 at 2:17 PM, Mike Rhoads <RHOADSM1@westat.com> wrote: > OK, the U.S. east coast earthquake has obviously addled my brain. > > data _null_; > rx = rxparse("/\d+/"); > rx = rxparse("/\d*/"); > rx = rxparse("/\d{3}/"); > rx = rxparse("/\d{1,3}/"); > run; > > The first 3 of these compile the regular expression just fine, but for the final one, I get the following error message in the log: > > ERROR: The following pattern expression passed to the function RXPARSE contains a syntax error. > /\d{1,3}/ > ^ > ERROR: Need a symbol to close an optional subexpression. > > I am certainly not an RX expert, but according to the documentation, this sure looks OK to me (SAS 9.2 TS2M3, WinXP). > > Thanks! > > > Mike Rhoads > RhoadsM1@Westat.com >


Back to: Top of message | Previous page | Main SAS-L page