for regexp gurus…

Aug 23, 2009 at 5:00pm

for regexp gurus…

Hi regexp gurus,
is there a simpler/clever way to do that (only one regexp object)?

Maybe I’ll improve my regexp knowledge…

many thanks

Matteo

– Pasted Max Patch, click to expand. –
#45196
Aug 23, 2009 at 5:17pm

This [regexp] looks for the word “fader” followed immediately by an integer, then a space and finally another number which could be a float or int. It remembers the numbers as backreferences and outputs them as a list. If you want a step by step of what each character is doing then just ask.

lh

– Pasted Max Patch, click to expand. –
#162849
Aug 23, 2009 at 9:17pm

Or you could do it the easy way

– Pasted Max Patch, click to expand. –

-A

#162850
Aug 24, 2009 at 9:53am

Many thanks LH and Andrew!
Just another little question about regexp:
is there an expression to substitute ‘fader’ with whatever word, so that regexp finds only a symbol (‘fader’, ‘slider’, ‘bing’, etc.)?*

Matteo

* for that purpose I was thinking about regexp rather than route.

#162851
Aug 24, 2009 at 10:02am

It seems I found solution by myself… but always open to suggestions
Many thanks again

matteo

– Pasted Max Patch, click to expand. –
#162852
Aug 24, 2009 at 1:58pm

Sorry to bother you again, but I don’t understand the correct syntax in the example below

many thanks

matteo

– Pasted Max Patch, click to expand. –
#162853
Aug 24, 2009 at 5:55pm

The regexp that doesn’t work for you will match a /slash/ followed by any positive integer followed by a space followed by any positive number. However the string you are entering doesn’t match this format, it has “/MP” in the middle which the regex can’t match. You might find it easier downloading [OSC-route] from the CNMAT website instead of writing your own regexps.

lh

#162854
Aug 25, 2009 at 2:41pm

many thanks, now regexp is much clearer.

Matteo

#162855

You must be logged in to reply to this topic.