help-octave
[Top][All Lists]
Advanced

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

Re: Aw: Re: regexp: matching expressions b4 and after ....


From: Ben Abbott
Subject: Re: Aw: Re: regexp: matching expressions b4 and after ....
Date: Tue, 09 Sep 2008 08:36:13 -0400

On Tuesday, September 09, 2008, at 06:17AM, <address@hidden> wrote:
> 
>
>Hi,
>
>thanks for the reply Ben. 
>As you see in your attempt, also the first "(-1)" gets replaced, which is 
>exactly what the regexprep example command (in MATLAB) avoids.

hmmm ... Matlab gives me the result below ...

>> g='x^(-1)+y(-1)+z(-1)=0';
>> regexprep(g,'(?<=[a-z]*)\(\-[1-9]*\)','\_minus1')
ans =
x^_minus1+y_minus1+z_minus1=0

What does matlab give you?

Ben


reply via email to

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