From: tad.a.digger@gmail.com
To: ruby-core@ruby-lang.org
Subject: [ruby-core:83914] [Ruby trunk Feature#12275][Assigned] String unescape
Date: Tue, 28 Nov 2017 06:37:58 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-67965.20171128063757.c7e0a84fe34946d5@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-12275.20160412190303@ruby-lang.org
Issue #12275 has been updated by tad (Tadashi Saito).
Status changed from Open to Assigned
Assignee set to tad (Tadashi Saito)
----------------------------------------
Feature #12275: String unescape
https://bugs.ruby-lang.org/issues/12275#change-67965
* Author: asnow (Andrew Bolshov)
* Status: Assigned
* Priority: Normal
* Assignee: tad (Tadashi Saito)
* Target version:
----------------------------------------
I think it will be usefull to have function that convert input string as it was written in prime qouted string or in double qouted string. It's part of metaprogramming.
Example:
~~~ ruby
class String
# Create new string like it will be writed in qoutes. Optional argument define type of qouting used: true - prime qoute, false - double qoute. Default is double qoute.
def unescape prime = false
eval( prime ? "'#{self}'" : "\"#{self}\"" )
end
end
"\\\t".unescape # => "\t"
~~~
Other requests:
http://www.rubydoc.info/github/ronin-ruby/ronin-support/String:unescape
http://stackoverflow.com/questions/4265928/how-do-i-unescape-c-style-escape-sequences-from-ruby
http://stackoverflow.com/questions/8639642/best-way-to-escape-and-unescape-strings-in-ruby
Realized
http://www.rubydoc.info/github/ronin-ruby/ronin-support/String:unescape
---Files--------------------------------
benchmark.rb (193 Bytes)
v1.patch (8.95 KB)
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2017-11-28 6:38 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-12275.20160412190303@ruby-lang.org>
2016-04-12 19:03 ` [ruby-core:74903] [Ruby trunk Feature#12275] String unescape asnow.dev
2016-04-12 19:04 ` [ruby-core:74904] " asnow.dev
2016-04-12 19:05 ` [ruby-core:74905] " asnow.dev
2016-04-20 4:01 ` [ruby-core:75040] [Ruby trunk Feature#12275][Feedback] " shyouhei
2016-05-12 15:43 ` [ruby-core:75474] [Ruby trunk Feature#12275] " asnow.dev
2016-05-13 6:44 ` [ruby-core:75483] [Ruby trunk Feature#12275][Open] " shyouhei
2016-07-19 6:00 ` [ruby-core:76411] [Ruby trunk Feature#12275] " matz
2017-11-18 13:27 ` [ruby-core:83816] " tad.a.digger
2017-11-19 10:11 ` [ruby-core:83822] " duerst
2017-11-24 7:05 ` [ruby-core:83874] " tad.a.digger
2017-11-24 8:04 ` [ruby-core:83875] " duerst
2017-11-25 8:20 ` [ruby-core:83880] " tad.a.digger
2017-11-27 19:58 ` [ruby-core:83896] " tad.a.digger
2017-11-28 6:37 ` tad.a.digger [this message]
2017-12-03 11:07 ` [ruby-core:84064] " tad.a.digger
2017-12-09 18:05 ` [ruby-core:84144] " tad.a.digger
2017-12-13 20:44 ` [ruby-core:84242] " tad.a.digger
2017-12-14 8:52 ` [ruby-core:84259] " tad.a.digger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-67965.20171128063757.c7e0a84fe34946d5@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).