octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #35911] Backslash escaping in regexprep replac


From: Rik
Subject: [Octave-bug-tracker] [bug #35911] Backslash escaping in regexprep replacement string incompatibility
Date: Fri, 30 Mar 2012 00:23:13 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0

Follow-up Comment #6, bug #35911 (project octave):

For the original reporter, can you verify that the only string which undergoes
interpolation in Matlab is the replacement string?  Or do the original string
and the pattern string also need this same fix?

For the original string, try the following


regexprep ('n', '.', 'X')


This will return either 'X' or 'XX' depending on whether interpolation is
done.

For the pattern string, try


str = sprintf ('anb');
regexprep (str, 'n', 'X')


If interpolation is active this should come out 'aXb'.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35911>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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