Created
December 19, 2011 22:18
-
-
Save henrik/1499164 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> "1 a b".scan(/[[:alpha:]]/) | |
=> ["a", "b"] | |
>> "1 a b".scan(/[:alpha:]/) | |
=> ["a"] | |
>> "1 a b".scan(/[\s]/) | |
=> [" ", " "] | |
>> "1 a b".scan(/\s/) | |
=> [" ", " "] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, @infixfilip figured it out! https://twitter.com/filip/status/149064513122074624
Line 3 is simply interpreted as
/[alp:]/
or/(a|l|p|:)/
, not as a character class.