From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id E31B61F531 for ; Mon, 10 Aug 2020 07:09:45 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 5A2F312095E; Mon, 10 Aug 2020 16:09:12 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 132A5120956 for ; Mon, 10 Aug 2020 16:09:09 +0900 (JST) Received: by filterdrecv-p3mdw1-7ff865655c-r62j4 with SMTP id filterdrecv-p3mdw1-7ff865655c-r62j4-19-5F30F2B2-E 2020-08-10 07:09:38.204834754 +0000 UTC m=+996798.882497805 Received: from herokuapp.com (unknown) by ismtpd0029p1iad2.sendgrid.net (SG) with ESMTP id 7bJCtwHvRSerp6wjriy3gg for ; Mon, 10 Aug 2020 07:09:38.143 +0000 (UTC) Date: Mon, 10 Aug 2020 07:09:38 +0000 (UTC) From: entpman@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75359 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 17110 X-Redmine-Issue-Author: theplen X-Redmine-Sender: theplen X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?u3J6FcLyubKYZW7UcsTESUt7toFgfsdsoaGdjebQpBRj4YdheLDLM1sXpkiHIf?= =?us-ascii?Q?pYJx8YcJvda944yIsYeDmFC7PQim67fZqPzzDZD?= =?us-ascii?Q?Kg4JS5DebO+I2qMhSfdyKV7mMTDvmUI7B6stIHN?= =?us-ascii?Q?AWO1n4U4lI0Fr7ddOiau25+mivOfQSqZ1gY=2FFvO?= =?us-ascii?Q?cXQ2UPjtHFBUeWmJ0DgB8Wa5VdQpstg5xx1TgTo?= =?us-ascii?Q?HHAc+pbYtWtg0gmF8=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99533 Subject: [ruby-core:99533] [Ruby master Bug#17110] String.tr unexpected behaviour with backslash X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17110 has been updated by theplen (Joey Sheets). Is there no way to do change all backslashes to forward slashes and forward slashes to backslashes in the same tr command? ``` ruby # Should result in "/\\" but instead results in "\\/" (unchanged) "\\/".tr("\//","\\/") ``` ---------------------------------------- Bug #17110: String.tr unexpected behaviour with backslash https://bugs.ruby-lang.org/issues/17110#change-86993 * Author: theplen (Joey Sheets) * Status: Rejected * Priority: Normal * ruby -v: ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x64-mingw32] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- `"\\".tr("\\","A")` works great, with `"\\"` becoming `"A"`. `"\\".tr("\\C","AB")` should also output `"A"`, but instead outputs `"\\"`. -- https://bugs.ruby-lang.org/