http://qs1969.pair.com?node_id=11129012


in reply to Looking for alternative syntax for assigning variables based on regex matches

"There's More Than One Way To Do It." – Tim Toady.

However you choose to do it, make your code easy for a human reader to understand, and easy to change in one small, targeted, "git" commit. What you've written is clear enough, and I would just keep doing it.