Bug #9087

swallowing "s" letters when "i" flag is on

Added by Dawid Grzesiak 6 months ago. Updated 6 months ago.

[ruby-core:58199]
Status:Closed
Priority:Low
Assignee:-
Category:regexp
Target version:-
ruby -v:ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

This regexp is removing 's' characters from the string

irb(main):091:0> "fdsa-f fdas5-423432".gsub /[\W]/i, ''
=> "fdaffda5423432"

While this is not:

irb(main):092:0> "fdsa-f fdas5-423432".gsub /[\W]/, ''
=> "fdsaffdas5423432"
irb(main):093:0> "fdsa-f fdas5_-423432".gsub /[0-9a-z]/i, ''
=> "fdsaffdas5423432"


Related issues

Duplicates ruby-trunk - Bug #4044: Regex matching errors when using \W character class and /... Feedback 11/11/2010

History

#1 Updated by Martin Dürst 6 months ago

  • Status changed from Open to Closed

Closed because it's a duplicate (of #4044).

Also available in: Atom PDF