Forums > MaxMSP

regexp @sustitute and espace

April 11, 2009 | 12:07 pm

hello

i am trying tu substitute !20 by a space using regexp.

for instance a box message like thad [a!20v] should write in the output this other one [a v]

with this arguments

[[regexp (!20) @substitute \s]]

regexp gives that

[asv]

jmb


April 11, 2009 | 1:52 pm

You can’t use regexp metacharacters in the substitution string, you need to use the literal characters. So you want something like:

[regexp (!20) @substitute " "]

I’ve just uploaded a patch which aims to explain [regexp] with some examples of how to use it. You might find it helpful, the link is below.

lh

http://www.thelightningbolts.com/luke/regexes.html


April 11, 2009 | 2:25 pm

many thanks, lh

your answer has been very helpful

jmb


Viewing 3 posts - 1 through 3 (of 3 total)