Search for keywords inside a list of symbols

Loukas Perreault's icon

Weird title... sorry.
Like you would inside the finder or explorer, I'd like to be able to search for keywords inside a coll (or any stored list).

Here is my example :

List is stored in a coll :

amazing_rock_guitar_loop.wav
cool_guitar2_loop.wav
piano_loop.wav
piano2_loop.wav

If, for example, I send the message "guitar", the output would be this list :
amazing_rock_guitar_loop.wav cool_guitar2_loop.wav

Any idea on how to achieve this?
Thank you

Ben Bracken's icon

You could dump the contents out and then run it through a [regexp]. One way:

Max Patch
Copy patch and select New From Clipboard in Max.

Loukas Perreault's icon

Omg this is exactly what i needed! It's been hours that I tried doing something with regexp and could find this simple way of using regexp ahaha! Thanks so muuuch!

Loukas Perreault's icon

Small other question. Is it possible to kind of $1 the regexp? regexp .*$1.* and we send it a message?

Ben Bracken's icon

Probably the best way to do this is to use the 're' message:

Max Patch
Copy patch and select New From Clipboard in Max.

Loukas Perreault's icon

Wow!! Im mindblown :D Thank you very much!!

Russell Richards's icon

Ben Bracken - that is genius. Nice one. Thanks for posting this.