Actions
Bug #11311
closedSTRING::Scan method badly interpret i option - Ruby 2.1.*
Description
'SKYPE'.scan(/[^aeiouyAEIOUY\W]/i) #returns ["P"] instead of ["S", "K", "P"]
Tested on Ruby 2.1.3 / 2.1.5 / 2.1.6
regexp i option: case insensitive
https://github.com/ruby/ruby/blame/trunk/string.c#L7681
Updated by gayahel (Agathe Begault) almost 10 years ago
'SKYPE'.scan(/[^aeiouyAEIOUY\W]/i) #returns ["P"] instead of ["S", "K", "P"]
'SKYPE'.scan(/[^aeiouyAEIOUY\W]/) #returns ["S", "K", "P"]
Tested on Ruby 2.1.3 / 2.1.5 / 2.1.6
regexp i option: case insensitive
https://github.com/ruby/ruby/blame/trunk/string.c#L7681
Updated by cremno (cremno phobia) almost 10 years ago
That's a known and documented bug:
/\W/
- A non-word character ([^a-zA-Z0-9_]
). Please take a look at Bug #4044 if using/\W/
with the/i
modifier.
It has been fixed by Onigmo 5.15.0 / Ruby 2.2. Maybe it can or even should be backported?
Updated by jeremyevans0 (Jeremy Evans) almost 6 years ago
- Status changed from Open to Closed
Actions
Like0
Like0Like0Like0