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 02:59:15 -0700 (PDT)


--- On Thu, 9/16/10, John W. Eaton <address@hidden> wrote:

> From: John W. Eaton <address@hidden>
> Subject: Re: Specific fixed width question...
> To: "CdeMills" <address@hidden>
> Cc: address@hidden
[snip]
> Is there a good way to write the above
> using a regexp that
> will only match the data in columns 4-6, 8-10, and 37-39?
> 
> jwe


Well, in Perl (and, I guess, in PCRE used by Octave) '.' matches any
character, so, say, the following

$s =~ m/^.{3}(.{4}).{5}(.{6})/;
#              $1        $2

skips 3 character from the beginning, then matches 4 characters and puts
them into $1, then skips 5 characters and then matches 6 characters and
puts them into $2.

I am not that familiar with Octave RE syntax; I hope the above can easily
be translated.

Regards,
  Sergei.


      


reply via email to

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