Sorry for asking such an explicit 'how do i do this' type question. I'd normally prefer to ask 'what technique should i use to do this'.....
I have a (osc) message of the form:
/deviceName/INSTANCE_ID/controlName/CONTROL_INSTANCE_ID data1 data2 data3....etc
I'd like to pass the address (i.e. first section) of this message through a regexp object such that if the "deviceName" and "controlName" match those expected (i.e. those written into the regexp string) I obtain a max message (list) of the form:
INSTANCE ID controlName CONTROL_INSTANCE_ID
I know I could do this with [OSC-Route] and a wildcard, but this would produce INSTANCE_ID#s as strings such as "/2". This is no good as the string requires further processing to remove the leading slash to be usable as an integer.
(For bonus points, I intend to target a pattr object who's scripting name is "controlName[CONTROL_INSTANCE_ID]" - can the regexp format its output like this, or do I still need to run it through a [sprintf %s[%ld] ]?)
Similarly, does regexp have 'the power' to convert a symbol such as "word[number]" into the following list:
(or for more bonus points, into the symbol "word/number" without using [sprintf %s/%ld ])
Or is there a better object to parse the 'word' and/or 'number' from the symbol "word[number]"?
Again, apologies for such a direct request. I'll happily accept a link to decent regexp examples/tutorials as an answer (the reference/help files are failing to overcome the mental block I have when it comes to regexes and how these relate to the output produced by regexp)