help-octave
[Top][All Lists]
Advanced

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

Positional operators at regexprep


From: John W. Eaton
Subject: Positional operators at regexprep
Date: Tue, 04 Dec 2007 12:46:21 -0500

On 27-Nov-2007, KalleWirsch wrote:

| 
| 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.

It looks like a missing feature to me.  Maybe someone would like to
submit a patch?

jwe


reply via email to

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