[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
regexp: matching expressions b4 and after ....
From: |
giovanni . lombardo |
Subject: |
regexp: matching expressions b4 and after .... |
Date: |
Mon, 8 Sep 2008 17:38:13 +0200 (CEST) |
Hi,
I'm trying to convert a set of matlab codes into Octave. These codes heavily
use string manipulation functions
In particular I'm trying to extract a set of equations from an ASCII file. From
these equations I extract/replace variables etc.
So, for example, I have g="x^(-1)+y(-1)+z(-1)=0"
I need to extract/replace x, y and (-1). So, for example, I used the command
regexprep(g,'(?<=[a-z]*)\(\-[1-9]*\)','\_minus1')
which returned "x^(-1)+y_minus1+z_minus1"
Can I do the same in Octave? How?
Thansk,
Gianni
- regexp: matching expressions b4 and after ....,
giovanni . lombardo <=