help-octave
[Top][All Lists]
Advanced

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

Positional operators at regexprep


From: KalleWirsch
Subject: Positional operators at regexprep
Date: Tue, 27 Nov 2007 14:18:48 -0800 (PST)

Hi,
excuse me for my badly englisch.

At Matlab positional operators are defined as follows 
 "Positional operators in an expression match parts of the input string
not by content, but by where they occur in the string (e.g., the first N
characters
in the string).
\<expr
Match expr when it occurs at the beginning of a word.
expr\>
Match expr when it occurs at the end of a word.

I have a problem with the characters \< \> because octave don't recognize # 
inside \< \>.
For example in octave I worked with ...
str = 'My flowers #may bloom in May';  Character "#" is important in my
case. Octave can't process with it in this context
pat = '\<#may\>';
regexprep(str, pat, 'April')

Octave afford the following result... ans = My flowers #may bloom in May. 
Well it's wrong i want to get this result... ans = My flowers April bloom in
May. 

Have anyone an idea because of my problem with \<# \>
I hope you can understand my question.

Regards KalleWirsch
-- 
View this message in context: 
http://www.nabble.com/Positional-operators-at-regexprep-tf4884837.html#a13981229
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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