How to split message by another character sequence rathen than space?

nuno's icon

I know that if I have a message like "some random text" I can use zl iter to give me first "some", then "random" and then "text".

I wish to do the exact same thing but with another character rather than the " " (space). Is it possible, how?

Ideally I would be able to do it with a character sequence, "|||", for instance.

Thanks.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Like this?

nuno's icon

Thanks for your reply.

I am getting a message in the Max window (a warning, I suppose, since it's in yellow) which reads: "#N: extra arguments for message "fromsymbol"". The output printed is the same as the list, so it didn't worked as supposed.

Any idea, why? Thanks.

Christopher Dobrian's icon

No idea. What I posted works for me in Max 5 and Max 6. You aren't using Max 4 by any chance are you? And you didn't change anything (like maybe a space somewhere)? If you want to post what you have that's malfunctioning, I'll try it on my computer.

nuno's icon

I am using Max 5. That's strange then. Anyway, I have found another way to overcome what I initially was trying to accomplish. Thanks anyway.

KrisW's icon

@nuno could you then please share your discoveries ? i have a similar problem .

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

i have a list that contain path's with additional data . how to provide such splitting and keep the path formatting (in quotes) as in original ? i know that [tosymbol] and [fromsymbol] are messing all the data in my example ,its just for presentation .

Im in need to get those lists separately . I could not find any common solution . as u can see there is a special need for keeping the path formatting ,and those lists contain variety amount of elements .
Ive also tried to use [regexp] in different logic but somehow it cuts the "zeros" from the lists . like 06 becomes 6 :/

i hope to hear from you guys

KrisW's icon

Hello Nicolas !
Thank you for the input ,

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

but please take a look :
everything is as should be while you print the results !
but if you want to use that data ,you are still getting these "backslash escapes" wrapped around the quotes . Looking at your second regexp i can tell that it should do the job . but its not ?

KrisW's icon

it works . wonderful !
thank you very much for your huge help and time Nicolas , it seems to be a bit more tricky than i thought .

KrisW's icon

and with comma's :/ ... Nicolas ? did you provided those expressions from head directly ? if so , im amazed ... im not going to learn it, i guess . im glad that you came across

KrisW's icon

i found Luke Hall's regular expression tutorials ( nice effort from Luke - thanks! ). if someone need to dig in