Date: Thu, 17 Mar 2005 11:13:33 -0800
Reply-To: lzhang9830@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lei Zhang <lzhang9830@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: What is the regular expression for SAS format name?
Content-Type: text/plain; charset="iso-8859-1"
Hi Richard and Gary,
Thanks a lot for your kind message. It helps me a lot! What I
want to do is to parse
a SAS format statement separated by a SAS format. For example,
For example:
"a b c 2.8 e f g $fmt. u v w $abc12.1 a b c A1224.123
$char8.2"
will be parsed into
a b c due to 2.8
e f g due to $fmt.
u v w due to $abc12.1
a b c A1234.123 due to $char8.2
I came up with a RE as follow
'/\$?[_a-zA-Z]\w{0,31}\.\d{0,2}/'
as the separator of a Format-like string, but it does not always work
at all kinds of situations.
Your advice will be very much appreciated. Thanks
LZ
|