Project

General

Profile

Feature #11429

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

Currently, this assigns the `username` variable: 

 ```ruby ``` 
 /(?<username>.*)@.*\..*/ =~ "[email protected]" 
 ``` 

 But this does not: 

 ```ruby ``` 
 /(?<username>.*)@.*\..*/ === "[email protected]" 
 ``` 

 If it did, it would be possible to set variables during a case statement, which was my original goal: 

 ```ruby ``` 
 case "[email protected]" 
 when /(?<username>.*)@.*\..*/ 
   puts "Username is: #{username}" 
 end 
 ``` 

 I would be happy to implement this, if it's a desired feature.

Back