[Tfug] SNOBOL expression

Bexley Hall bexley401 at yahoo.com
Tue Feb 28 18:31:14 MST 2006


Grrrr...  I should learn to be more specific in
my questions.  :-(  Sorry!  (my bad)

Thanks to those who responded -- see clarification
below...

--- "Bowie J. Poag" <bpoag at comcast.net> wrote:
 
> I work with a guy who knows SNOBOL, I think. Want me
> to run it by him?

Yes, please.

What I was trying to illuminate was how matching is
perfomed in SNOBOL vs., for example, regexp.

For the example I gave, both will match strings of
zero or more alphabetic characters (assuming ALPHA
is thusly defined).  *But*, what portions of that
string each "component" (clause) matches is very
different!  (hence the reason for putting the
regexp clauses in paren's)

So, given "ABCD", the first of the regexp clauses
would match "ABCD" while the second would match
the "" on the end of that input string.

OTOH, the first ARBNO would match the "" at the
*beginning* of that input string while the
*second* would match "ABCD".

I.e. regexp uses a "greedy" match while SNOBOL
uses a "reluctant" match.  Only really significant
if you want to figure out what *each* clause is
responsible for matching (as if you refered to
the regexp clauses thereafter or assigned each
ARBNO result to a specific variable)

Can you think of a better example to highlight
this difference?  <:-(


> Bexley Hall wrote:
> 
> >Anyone proficient in SNOBOL, here?  (yeah, I
> know...
> >a long shot  :<  )
> >
> >In particular, to verify the subtle difference
> >between, e.g.,
> >
> >([:alpha:]*)([:alpha:]*)
> >
> >and
> >
> >ARBNO(ALPHA) ARBNO(ALPHA)
> >
> >Hmmm... maybe I should just see if there is an
> >interpreter available and run some test cases...
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> >http://mail.yahoo.com 
> >_______________________________________________
> >Tucson Free Unix Group - tfug at tfug.org
> >Subscription Options:
> >http://www.tfug.org/mailman/listinfo/tfug
> >
> >  
> >
> 
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the tfug mailing list