regexp: PCRE error -10 – possible max 5 bug

May 29, 2008 at 12:22pm

regexp: PCRE error -10 – possible max 5 bug

Hi All,

I’ve created a patcher in max 5 that uses hi to create menu of connected devices and I output this to regexp to find devices of specific types (with the possibility of more than one of t he same type). The search works fine, so that’s not the problem, but I keep getting an annoying error message in the max window every time I do the search- regexp: PCRE error -10. Maybe if I wasn’t so anal this wouldn’t bother me, as the patcher still seems to work ok. But that’s just the way I am… so it does. I’ve looked up perl error codes, and apparently error -10 isn’t used… hmmm.

Basically my patcher sends a “menu” message to the hi object. The right output is connected to a regexp “Apple Internal Keyboard / Trackpad 2″ with the third regexp output printing to the max window. I’ve attached the maxpat to see if anybody else gets the same error message.

The same patcher recreated for max 4.6.3 works fine with no error messages, so I reckon its a max 5 bug.

I’ve also tried creating a list from the hi output and sending that to regexp instead and I get the same error message, unless I edit the message manually and resend it. Voila no error. Wierd. Possibly something to do with the “end of line” or some other hidden character for each string being sent to regexp?

Cheers,

David

#38141
May 29, 2008 at 7:23pm

I don’t see this error here on either Mac or PC.

Are you using Max 5.0.2? If not, please update. What OS/computer model are you running?

-Ben
Cycling ’74 Support

#132436
May 29, 2008 at 8:37pm

Sorry Ben, forgot to say…

I am running max 5.0.2 on a OSX 10.4.11 macbook pro.

I just tried the file I sent as an attachment on my mbpro and it worked fine… strange. Could it be something to do with the 2 monitor setup I have at work? – this has previously caused max 5.0.2 to crash over the most bizarre things. I’ll test a few things out tomorrow and report back. No error message without the 2nd monitor at the moment though…

Cheers,

David

#132437
May 30, 2008 at 8:52am

OK back at work. Just plugged in all my usual – lcd monitor, usb hub with keyboard, mouse, etc. Error message back again…

By unplugging everything and replacing one at a time (restarting max each time) I have whittled it down to a problem with my microsoft wireless mouse. The hi object detects it as “Microsoft Wireless Optical Mouse( 1.00″. Something to do with the lack of close bracket, maybe?

Oh well. At least I know what it is now and can safely ignore it. Thanks again, Ben, for helping out – just needed to know if it was a problem with max or my setup.

Cheers,

David

#132438
May 30, 2008 at 9:23am

The problem is likely the unescaped ‘(‘ since ‘(‘ is a magic character when forming regular expressions. But if you can make a simple patch which demonstrates the input which causes the error, I could see better if there is, in fact, a regexp problem.

jb

#132439
May 30, 2008 at 10:03am

#132440
May 30, 2008 at 10:19am

Maybe you can simply write in a comment or in a message to this forum, what exactly is coming out of ‘hi’, so I can type it into a message box and send it to the regexp object you sent previously.

jb

#132441
May 30, 2008 at 10:51am

#132442
May 30, 2008 at 10:56am

The non utf-8 character conversion I mentioned appears to have changed the “(” to a “*” in the text I sent:

> “text” : “”Microsoft Wireless Optical Mouse* 1.00″ S

So you won’t get the error message if you try it…

D

#132443
May 30, 2008 at 11:07am

#132444
Feb 23, 2011 at 12:07pm

I stumbled across this thread Googling on “PCRE Error 10″. It may actually be an issue with the hi object.

A simple patch demoing the error message below. Note that on my configuration, the error is documented with these two lines in the Max window

symbolToRegexp: Peter Castines Mouse
regexp: regexp: PCRE error -10

The device in question is listed in the Bluetooth menu as “Peter Castine’s Mouse” (‘smart’ apostrophe between my last name and the possessive s). The hi object seems to be replacing the apostrophe character with something else. FWIW, I sent the relevant symbol through a spell object, and the critical character was converted as ASCII 213. I’m not even sure if this is valid UTF-8. In any case it’s not the character it’s supposed to be.

Before I get tsuris for having named my HID with non-7bit-ASCII, Microsoft did it, too, and Microsoft is always right;-

USB.org lists some guidelines for dealing with Unicode, but I have no idea if anyone follows them.

Does any of this shed light on the regexp error message?

– Pasted Max Patch, click to expand. –

PS/Edit: I copy/pasted from the Max Window into the forum message panel, but the offending character was changed when posting the message to the forum. Don’t hang onto the specific text chars, it seems to simply be some sort of voodoo in hi’s processing of >127 ASCII/Unicode.

#132445
Feb 23, 2011 at 2:27pm

Hallo Peter,

since you posted this mail, Thunderbird can’t update the RSS feed of this forum…
Here is the error message in TB’s console:


Error: not well-formed
Source File: http://cycling74.com/forums/rss.php?forum=1
Line: 426, Column: 41
Source Code:

symbolToRegexp: Peter Castines Mouse

with an arrow pointing to the offending apostrophe.
I already warned c74 about those pesky ascii codes and asked to filter them out , but it seems they didn’t do it.

Now, once again I need to wait until the code is removed from the feed.

#132446
Feb 23, 2011 at 2:39pm

Sorry about that, Patrick!

Naughty ASCII.-)

#132447
Mar 25, 2011 at 6:07pm

Hi, I also found this thread trying to get a patch to work. Thanks to Peter Castine’s post I finally found out what was goning on.
“PCRE Error -10″ is produced by regexp when it receives a character with an ASCII or rather UTF-8 value lager than 127.
This patcher shows the issue:

– Pasted Max Patch, click to expand. –

Somehow a non-ASCII character had gotton into a message in my patcher and was causing the trouble. I was not able to see it in any message box. I could only detect it by using the ‘itoa’ object.

#132448
Nov 2, 2011 at 10:22am

for the common good,
here is a method to validtae data coming from jit.textfile to jit.str.regexp using [jit.op @op

----------begin_max5_patcher----------
616.3ocyV1saaBCFF9XpTuGrPZUaZojXHjPpVz1NXmtafprJSvg3JiMCaVRV
0t2qsIzltRBrEXrCPV74+d8ie+r8CWdgkcHeKVXCtAbKvx5AUDKSLcDqx.V1
InsKoHgog1L7Fd381C1WmDuUZheOQ5HjYNRtXWRHm9TKHQl5Uc5Z2fmhthyj
LTB1T2myHnm6.KOgvnXoY9fkQSQxkqIr36xvKkER1cpmynA.2YPcQvTyOibF
AVbvPwykkik6gStf7SyjCcUcae7h1J2khKl.a6ApOvBS0+5xKzkphAmMrRyH
LYUDxuK.jGzfFuw0AnQGCPsN.ztEdJ3SpuOnJ9AhplmfpHx3+Xh3dBh.m5Zf
fmo.5Mo88Lpk1cIHYFY645dBykRNqxDo+Bu.zjk.CFUtjO8BGdzEXHhE2EIE
kmfjgiwaUlhLLfjDmmQm+1a+1UKd+6tpRTLsUSYJMHS7MEvY0wI+yzfz7+NG
lmfEBTL90POjuSTEVgvosbhWg8CZLddAEdwFX+Z9Y0cjkT+yJBEWo4aRKa9f
E1MCd7q8BMuV060U.LmFU8qA76B3AKvl+r+mOY+X3RXdXvJPDeCixQQf0RY5
MCGtYyFmXNOlhcVxSFRRT4xhOtlNGyt9Ke8puO+MBPoxp.zi6DP6YNhzalei
uJ4LxkKFaaJg8pGrZjnthei3Bdd1xxQrLaEbfJivBIggjD0krO2pwurQqIQQ
X1KdcTBIJkq1m1KjS4CZr1F2DoouqqGzl9gY0KN+9QaZj3VK3B5Gw0nM0I8i
1z6WvZEWunMyiOZ.45mTU2lkq52eaq+K7b5.phGAM4MqW.
-----------end_max5_patcher-----------

#132449
Nov 2, 2011 at 11:41am

Oops, I posted something here that I meant for here by accident!

#132450

You must be logged in to reply to this topic.