Filtering out characters from strings or lists

Mark's icon

Is there a way in Max to filter out certain characters from a string or list?
For example I want to convert the following message:
"\"Track In\""
to:
Track In
or:
"\"1-Kit-Core 808\""
to:
1-Kit-Core 808
Basically i just want to strip out the " and \ characters.
Thanks


Mark's icon

[EDIT: I thought] I found a simple solution:
I just pass the messages through a [regexp \\w+] object and take the output of the 3rd outlet.
[regexp] with the above argument acts as a filter to non-alphanumerical characters (letters and numbers)

Mark's icon

Very naive of me. This will work fine in the case of "\"Track In\"" but not in the case of "\"1-Kit-Core 808\"" or other messages. I want characters such as - and | to pass through.
As I said in the original post, I just want to filter out the " and \ characters. I'm trying to do this with various [regexp] commands but it doesn't let me use these characters as arguments so it's tricky, so any help will be appreciated..

broc's icon

If " and \ are always combined the same as in your examples try this.

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

Mark's icon

Yes, this works. Thanks for the help broc!