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

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

[Octave-bug-tracker] [bug #37092] backslash escape character in regexp


From: Guillaume
Subject: [Octave-bug-tracker] [bug #37092] backslash escape character in regexp
Date: Wed, 15 Aug 2012 11:21:22 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1

Follow-up Comment #3, bug #37092 (project octave):

Thanks for your comments.

With MATLAB R2012a, I get this:

>> regexprep('','\','backslash')
ans =
backslash
>> regexprep('b','\b','backslash')
ans =
backslash


Let me know if you need other user cases.
I came across this with some MATLAB code I use to escape a string for
insertion in LaTeX:

regexprep(string,{'\','_'},{'\\','\_'})

I am not sure how to write some code that will work similarly for both Octave
and MATLAB.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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