Date: Thu, 7 Jul 2005 17:06:42 -0700
Reply-To: DavidL Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: DavidL Cassell <davidlcassell@MSN.COM>
Subject: Re: fuzzy string search
In-Reply-To: <MC9-F10rxTjtRpeVPOE000a4ad0@mc9-f10.hotmail.com>
Content-Type: text/plain; format=flowed
Jennifer_Lin@CHIRON.COM replied:
>I think you may want to look into using regular expressions. There are SAS
>RX functions available in SAS V8.1: RXPARSE, RXMATCH, etc...
>
>Apparently there are now also new Perl regular expression functions
>available in SAS V9. Look up functions PRXPARSE,
>PRXMATCH, PRXCHANGE, and PRXPOSN.
>
>PRX Function Reference:
>http://support.sas.com/rnd/base/topics/datastep/perl_regexp/regexp2.html
>
>These seem rather complicated unless you are already a PERL user, and I've
>never used them, but they seem powerful enough to use for even the most
>complicated fuzzy string searches.
No, they're really a piece of cake! Trust me!
Just because people keep saying Perl is a write-once/read-never language...
:-)
Seriously, the PRX... functions are easier to learn than the RX...
functions,
because there is a lot more in the way of resources for the Perl regular
expressions. You can go on the internet and I'll guess that you could
search for and find a dozen free Perl regex tutorials in seconds.
Plus, the Perl regexen are relatively intuitive (at least for me), with
basic
rules like
/Jen/ matches any string with 'Jen' in it
/(Jen|Jennifer)/ matches any string with 'Jen' or 'Jennifer'
If you're used to using () to group stuff in SAS, and | as a logical OR,
then you're already halfway there.
HTCT (Happy To Cause Trouble),
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/