I have a hash that looks like this:

```
{ "cell_number" => 1234567,  "lead source" => [ "referrel", "web", "ad" ], "lead source_selected" => "web" }

```

Now if there is a pattern where the key contains "x\_selected", then I want to return the entire hash, except for the x key. So in this case I want to return everything but "lead source":

```
{ "cell_number" : 1234567,  "lead source_selected" : "web" }

```

My attempt seems to work:

```
 h = { "cell_number" => 1234567,  "lead source" => [ "referrel", "web", "ad" ], "lead source_selected" => "web" }
 h.collect do |k,v|
  if k =~ /(.+)_selected$/
    h.delete( $1 )
  end
 end
 => [nil, nil, ["referrel", "web", "ad"]] 
 > h
 => {"cell_number"=>1234567, "lead source_selected"=>"web"} 

```

But is there a more ruby way to do this?