Filtering out characters from strings or lists
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
[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)
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..
If " and \ are always combined the same as in your examples try this.
Yes, this works. Thanks for the help broc!