Forums > MaxMSP

regexp problems/JS question

February 21, 2007 | 9:57 am

I’m having consistent crashes with Max’ built-in regexp object. I’m
now trying to use JS regular expressions.
I get an error when I try to use the standard JS function search, as
described in the CoreGuideJS15 pages:

function rxp(arg)
{
re = /ra/;

bla = re.search(arg);
post(bla);
}

I get an JavaScript type error: search is not a function. re.test
(arg) works fine?!

What am I missing? Am I using an outdated JS version?

Best,

Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl


February 21, 2007 | 10:14 am


February 21, 2007 | 10:53 am


February 21, 2007 | 11:47 am


February 21, 2007 | 11:54 am

Slightly OT: I love this site when working with js (also in max):

http://www.javascript-reference.info/

Mattijs

Quote: Zip Boterbloem wrote on Wed, 21 February 2007 10:57
—————————————————-
> I’m having consistent crashes with Max’ built-in regexp object. I’m
> now trying to use JS regular expressions.
> I get an error when I try to use the standard JS function search, as
> described in the CoreGuideJS15 pages:
>
> function rxp(arg)
> {
> re = /ra/;
>
> bla = re.search(arg);
> post(bla);
> }
>
> I get an JavaScript type error: search is not a function. re.test
> (arg) works fine?!
>
> What am I missing? Am I using an outdated JS version?
>
> Best,
>
> Zip Boterbloem
> Media Mechanics
> Zwaluwstraat 54
> 2025 VR Haarlem
> The Netherlands
> +31627014758
> zip@knoware.nl
>
>
>
>
>
>
—————————————————-


February 21, 2007 | 12:09 pm


February 21, 2007 | 12:23 pm

Nogmaals dank, Mattijs. Looks a bit messy but very useful.

Best,

Zip
Zip Boterbloem
Media Mechanics
Zwaluwstraat 54
2025 VR Haarlem
The Netherlands
+31627014758
zip@knoware.nl

Op 21-feb-2007, om 12:54 heeft Mattijs Kneppers het volgende geschreven:

>
> Slightly OT: I love this site when working with js (also in max):
> http://www.javascript-reference.info/
>
> Mattijs
>
> Quote: Zip Boterbloem wrote on Wed, 21 February 2007 10:57
> —————————————————-
>> I’m having consistent crashes with Max’ built-in regexp object. I’m
>> now trying to use JS regular expressions.
>> I get an error when I try to use the standard JS function search, as
>> described in the CoreGuideJS15 pages:
>>
>> function rxp(arg)
>> {
>> re = /ra/;
>>
>> bla = re.search(arg);
>> post(bla);
>> }
>>
>> I get an JavaScript type error: search is not a function. re.test
>> (arg) works fine?!
>>
>> What am I missing? Am I using an outdated JS version?
>>
>> Best,
>>
>> Zip Boterbloem
>> Media Mechanics
>> Zwaluwstraat 54
>> 2025 VR Haarlem
>> The Netherlands
>> +31627014758
>> zip@knoware.nl
>>
>>
>>
>>
>>
>>
> —————————————————-
>
>
> –
> SmadSteck – http://www.smadsteck.nl
> Interactive audiovisual sampling soft- and hardware
>


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