Forums > MaxMSP

Filter words from a list that begin with specific symbols

December 2, 2012 | 1:46 am

I’m not the best with reg expressions but I know what I’m trying to do is a pretty common task yet i’ve searched around without finding a solution so I’m reaching out to see if any of you could kindly help.

I’m trying to filter words from lists that begin with certain symbols.

For example if I had a list that was like "yes %no @maybe /so no"

and I wanted to remove the words that begin with the symbols % and @

my resulting list would be "yes /so no"

Does anybody know how to do this? I’m pretty sure that the right reg exp could take care of, but I’m having trouble figuring it out on my own. Thanks for whatever help you can offer.


December 2, 2012 | 9:13 am

this seems to work, but there is probably a better way (not having to use the prepend object) (ie I’m no expert in regex stuff)

– Pasted Max Patch, click to expand. –

December 2, 2012 | 11:01 pm

Terry & Nicolas, thank you much for the reply, these are really helping me to get closer to understanding the complex world of RegExpressions.

I’ve decided to go with Nicolas’s example :)


Viewing 3 posts - 1 through 3 (of 3 total)