help-octave
[Top][All Lists]
Advanced

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

Re: Dynamic operators in regular expressions


From: dbateman
Subject: Re: Dynamic operators in regular expressions
Date: Wed, 5 Mar 2008 14:21:52 -0800 (PST)



Robert Platt-2 wrote:
> 
> Hi,
> 
> It seems that Octave regexprep does not recognise the ${cmd}dynamic
> expression operator available in Matlab, because the ${}was replaced
> literally rather than a return value from the command. Probably this is
> not sucha commonly used feature but it would be very useful for a
> Matlab/Octave numerical toolbox we are developing...
> 
> Is this a known issue and could this feature be supported in future?
> 
> Rob
> 

Firstly try using singly quoted strings for at least the pattern and
replacement. That being said is the variable in the pattern or the
replacement? The regexp function can return the tokens matched, and I think
it was implemented to allow the the tokens to be used in the replacement
string of regexprep and in fact regexprep example

regexprep("Bill Dunn",'(\w+) (\w+)','$2, $1')

seems to work correctly. Is it the presence of the {} that is the issue? Is
this a documented matlab feature. Can you give a short example of the
failing code, that works in matlab?

D.

-- 
View this message in context: 
http://www.nabble.com/Dynamic-operators-in-regular-expressions-tp15859067p15861881.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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