|
From: | Rik |
Subject: | [Octave-bug-tracker] [bug #35911] Backslash escaping in regexprep replacement string incompatibility |
Date: | Sun, 25 Mar 2012 21:45:49 +0000 |
User-agent: | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0 |
Update of bug #35911 (project octave): Depends on: => bugs #33611 _______________________________________________________ Follow-up Comment #1: This is similar to bug #33611. It is unlikely that this will be fixed. Matlab made a poor decision not to have interpolated strings (double quote) and then they worked around it by occasionally having interpolation depending on the context (examples: printf format strings, regexprep replacement strings). Chasing this kind of bug-for-bug compatibility is not easy and not fun. For the examples you gave, it would be easiest to switch to interpolated strings in Octave by changing the single quote to a double quote. Then things like "\" will be transformed to just ''. This isn't too much of a problem if the number of regexprep calls in your code is small. Otherwise, you could write a Perl or Octave script to convert the last argument of all regexprep calls from single to double quote. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?35911> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |