My problem is I have a very large file, an example: 

```
f = %q(1:9- The cost of\n  
51:10- The beams cost so much\n  
41:11- Should we buy more beams\n  
21:12- Why buy more}  

```

What I need to do is, as an example, is extract every beams word from any line that contains that particular word. But each beams word must come with the reference for the line it comes from, like this: 

```
51:10 beams\n  
41:11 beams\n  

```

Any help is gratefully appreciated.