Consider the following regular expression, designed to validate a tab-separated string and extract data from it:
>> t = "a\tx\tb"
=> "a\tx\tb"
>> re = Regexp.new("a\t\S\tb")
=> a S b
>> re.match(t)
=> nil
>> re = Regexp.new("a\t[^\t]\tb")
=> a [ ] b
>> re.match(t)
=> #This, at first, had me glaring at the docs for Ruby's
(
Read more... )