help-octave
[Top][All Lists]
Advanced

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

Re: String Index


From: Przemek Klosowski
Subject: Re: String Index
Date: Mon, 27 Jun 2016 13:40:36 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 06/27/2016 11:43 AM, Thomas D. Dean wrote:

I played with regexp() some, but, could not find a pattern that matched just the characters within the parens.

I suggest matching from a paren, continuing along everything that is NOT a paren:

[s, e, te, m, t, nm, sp] = regexp(str,"[(]([^)]*)")

t =
{
  [1,1] =
  {
    [1,1] = 10^15 kg
  }
  [1,2] =
  {
    [1,1] = km
  }
  [1,3] =
  {
    [1,1] = kg/m^3
  }
}


reply via email to

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