Very concrete regexp question (TouchOSC related)

Learn about building and using Max for Live devices.
Post Reply
toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Very concrete regexp question (TouchOSC related)

Post by toscanini » Sun Mar 24, 2013 2:57 pm

Hello,
I have gone through ShelLusers excellent regexp tutorials but some aspects still remain unclear, namely routing issues. Most concretely I'd need to get the forelast element from /3/multitoggle3/6/1

All concrete help (and also a bit of extra theory around routing) most welcome!
toscanini

toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Re: Very concrete regexp question (TouchOSC related)

Post by toscanini » Sun Mar 24, 2013 6:48 pm

Trial and error but I am getting there :idea:

[regexp (.*)/(.*)/(.*)]

...and outputting from backreferences...

toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Re: Very concrete regexp question (TouchOSC related)

Post by toscanini » Sun Mar 24, 2013 8:12 pm

Ok there is still a problem left, what TouchOSC sends to [udpreceive] has either 3 or 4 elements. (by "elements" I mean the data between the slashes, for example /3/multitoggle3/6/1). I haven't found the solution yet that works both ways.
Something like [regexp /(.*)/(.*)/(.*)/?(.*)?] but better...

madlab
Posts: 1391
Joined: Fri May 02, 2003 6:38 am
Location: France

Re: Very concrete regexp question (TouchOSC related)

Post by madlab » Mon Mar 25, 2013 6:35 am

Were are these tutorials ? 8O
Aboard from V. 1
MBP M1 Pro 2021 - 16 Go RAM - Monterey 12.6.3
MBP 2.5 Ghz I7 16 Go SSD OSX 10.14
iPad + Mira+ TouchOsc
RME FF UC Live 11.3.21 M4L Max 8
Band : https://elastocat.org/
Madlab sound unit / objects, guitar, electronics / end_of_transmission

toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Re: Very concrete regexp question (TouchOSC related)

Post by toscanini » Mon Mar 25, 2013 8:12 am

http://synthfan.info/mytutorials/

"blog" tutorials on the bottom of the page.

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: Very concrete regexp question (TouchOSC related)

Post by broc » Mon Mar 25, 2013 10:22 am

toscanini wrote:Ok there is still a problem left, what TouchOSC sends to [udpreceive] has either 3 or 4 elements. (by "elements" I mean the data between the slashes, for example /3/multitoggle3/6/1). I haven't found the solution yet that works both ways.
Replacing slash by space will produce a list for any number of elements.

[regexp / @substitute " "]

toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Re: Very concrete regexp question (TouchOSC related)

Post by toscanini » Mon Mar 25, 2013 11:22 am

Lovely. I wouldn't claim I understand why, but it works!
No, wait! I actually do :lol:
thank you broc!

Machinate
Posts: 11648
Joined: Thu Jun 24, 2004 2:15 pm
Location: Denmark

Re: Very concrete regexp question (TouchOSC related)

Post by Machinate » Fri Mar 29, 2013 11:25 pm

broc wrote:[regexp / @substitute " "]
AKA: the only regexp I actually use. Like, ever. Makes OSC parsing ever so easy.

Alternatively one can just use OSC-route, but I typically prefer not to.
mbp 2.66, osx 10.6.8, 8GB ram.

Post Reply