Actions
Bug #11311
closedSTRING::Scan method badly interpret i option - Ruby 2.1.*
Bug #11311:
STRING::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
Updated by gayahel (Agathe Begault) almost 11 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 11 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/imodifier.
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) over 6 years ago
- Status changed from Open to Closed
Actions