Project

General

Profile

Feature #11429

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

Currently, this assigns the `username` variable: 

 ```ruby ``` 
 /(?<username>.*)@.*\..*/ =~ "seanlinsley@example.com" 
 ``` 

 But this does not: 

 ```ruby ``` 
 /(?<username>.*)@.*\..*/ === "seanlinsley@example.com" 
 ``` 

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

 ```ruby ``` 
 case "seanlinsley@example.com" 
 when /(?<username>.*)@.*\..*/ 
   puts "Username is: #{username}" 
 end 
 ``` 

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

Back