LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Sep 2010 15:39:12 -0500
Reply-To:     Joe Matise <snoopy369@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Joe Matise <snoopy369@GMAIL.COM>
Subject:      Re: parsing text
Comments: To: Tom Abernathy <tom.abernathy@gmail.com>
In-Reply-To:  <201009102029.o8AJmekO006723@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1

I agree in this particular instance SCAN is superior. However, REGEXs are quite handy for other things. As Paul/Mikeeeee/etc. would say, the best tool is the tool that solves the current problem. :)

-Joe

On Fri, Sep 10, 2010 at 3:29 PM, Tom Abernathy <tom.abernathy@gmail.com>wrote:

> I am reminded again why have never spent much time learning this regular > expression stuff. Most of the problems I deal with are like this example > where the existing SAS functions are not only more efficient, but easier to > understand. > > scan(the_source_string,-1,'()') > > versus > > > prxparse('/.*?\((.*)\).*/') as prxm, > > case when prxmatch(calculated prxm,the_source_string) then > > prxposn(calculated prxm , 1, the_source_string ) else ' ' > > end >


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