From: xovatdev@... Date: 2015-08-10T20:43:27+00:00 Subject: [ruby-core:70319] [Ruby trunk - Feature #11429] Local variable assignment via regex === Issue #11429 has been updated by Sean Linsley. Subject changed from Local variable assignment Regex via === to Local variable assignment via regex === ---------------------------------------- Feature #11429: Local variable assignment via regex === https://bugs.ruby-lang.org/issues/11429#change-53740 * Author: Sean Linsley * Status: Open * Priority: Normal * Assignee: ---------------------------------------- Currently, this assigns the `username` variable: ``` /(?.*)@.*\..*/ =~ "seanlinsley@example.com" ``` But this does not: ``` /(?.*)@.*\..*/ === "seanlinsley@example.com" ``` If it did, it would be possible to set variables during a case statement, which was my original goal: ``` case "seanlinsley@example.com" when /(?.*)@.*\..*/ puts "Username is: #{username}" end ``` I would be happy to implement this, if it's a desired feature. -- https://bugs.ruby-lang.org/