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 (February 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 4 Feb 2009 16:20:56 -0500
Reply-To:   Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject:   Re: Find position of last occurrence of character in a string
Comments:   To: Toby Dunn <tobydunn@HOTMAIL.COM>

On Wed, 4 Feb 2009 15:54:04 -0500, Toby Dunn <tobydunn@HOTMAIL.COM> wrote:

>Position = PRXMatch( '/\/[a-z|1-9| ]+$/i' , Text ) ; ... hi tody, a good try, but what if there is a dot or a comma? or what if the slash is the last character? below is one that can handle all these. hth. cheers, chang

data _null_; x="abc/abc/abc/333"; /* find the pos of the last slash char */ pos = prxmatch("|/[^/]*$|", x); put x= pos=; run; /* x=abc/abc/abc/333 pos=12 */


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