Project

General

Profile

Bug #6161

Document interpretation of backslashes in string transliterations

Added by john_firebaugh (John Firebaugh) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
Backport:
[ruby-core:<unknown>]

Description

=begin
The transliteration string accepted by String#tr, #delete, #squeeze, and #count has its own backslash escape syntax (on top of that provided by string literals), but it isn't documented.

A backlash character escapes the subsequent character, unless it is the ending character of a range designator (e.g. (({X-}))) or the final character, in which case it is interpreted literally. This can be used to prevent a leading (({})) from interpretation as the complement operator and (({-})) from interpretation as the range operator.
=end

Updated by drbrain (Eric Hodel) over 8 years ago

  • Assignee set to drbrain (Eric Hodel)
#2

Updated by shyouhei (Shyouhei Urabe) over 8 years ago

  • Status changed from Open to Assigned
#3

Updated by drbrain (Eric Hodel) over 8 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r35291.
John, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • string.c (rb_str_tr): Documented use of \ to escape characters. [ruby-trunk - Bug #6161]
  • string.c (rb_str_count): ditto

Also available in: Atom PDF