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: John W. Eaton
Subject: [Octave-bug-tracker] [bug #35911] Backslash escaping in regexprep replacement string incompatibility
Date: Thu, 29 Mar 2012 03:31:14 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2 Iceweasel/10.0.2

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

I think what you want to do is something like this:


  std::string replacement = args(2).string_value ();
  if (error_state)
    return retval;
  if (args(2).is_sq_string ())
    replacement = do_string_escapes (replacement);


See the attached diff.  Does this change do the right thing?  If so, feel free
to add a test that checks that backslash escaping is handled specially for
single-quoted strings and check it in.

(file #25502)
    _______________________________________________________

Additional Item Attachment:

File name: diffs.txt                      Size:0 KB


    _______________________________________________________

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]