help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Specific fixed width question...


From: Sergei Steshenko
Subject: Re: Specific fixed width question...
Date: Thu, 16 Sep 2010 07:07:06 -0700 (PDT)


--- On Thu, 9/16/10, Judd Storrs <address@hidden> wrote:

> From: Judd Storrs <address@hidden>
> Subject: Re: Specific fixed width question...
> To: "Sergei Steshenko" <address@hidden>
> Cc: "CdeMills" <address@hidden>, "John W. Eaton" <address@hidden>, 
> address@hidden
> Date: Thursday, September 16, 2010, 6:32 AM
> On Thu, Sep 16, 2010 at 5:59 AM,
> Sergei Steshenko <address@hidden>
> wrote:
> > $s =~ m/^.{3}(.{4}).{5}(.{6})/;
> > #              $1        $2
> 
> This particular task doesn't really need pattern matching
> so why
> bother with a search? Cutting strings up is exactly what
> scanf does.
> Why is "^.{3}(.{4}).{5}(.{6})" superior to
> "%*3c%4d%*5c%6d"? What's
> the benefit?
> 
> 
> --judd
> 
> Some people, when confronted with a problem, think ``I
> know, I'll use
> regular expressions.'' Now they have two problems. --jwz
> 

JWE asked, I answered. Actually, unlike, I think that regular expressions
is a more generic/robust/flexible mechanism. But I wrote a lot of pretty
serious parser in my life, so regular expressions are probably a part of
me now.

Regards,
  Sergei.



      



reply via email to

[Prev in Thread] Current Thread [Next in Thread]