Search/replace comma with jit.str.regexp

ostowe's icon

All I need to do is replace commas in an HTML document with periods. I've been researching how to do this to no avail. Any ideas? It seems like it would be simple enough, but jit.str.regexp doesn't seem to like commas very much.

Stranger still: what I currently have worked ONCE, but never again. The error I get is PCRE error -10.

Here's my patch so far:

Max Patch
Copy patch and select New From Clipboard in Max.

Thanks for any help!

Luke Hall's icon

Looks like you're just using the wrong outlet of [jit.str.regexp]. Try using the second outlet to send out the substitutions (it's not exactly the same as [regexp] which might be what is confusing you), otherwise the expressions you are using work very well.

ostowe's icon

Oops! You were definitely right about that, thanks for the help! However, when I switched that connection, everything worked once, then stopped working again. Another problem: Jit.uldl is not downloading the entire html file. That, or jit.textfile is somehow not holding the entire document in its buffer. I'm really at a loss here.

Edit: Is it possible it's failing to download because the HTML uses non-ascii characters? The place names in the document are Icelandic, so there are a lot of accents.

Edit 2: Yes, I have confirmed there is one non-ascii character in there. It's this: ð. What should I do about this?

Luke Hall's icon

That might be one to email support about!

ostowe's icon

I actually fixed it. I limited the jit.uldl output values to 0-127 (only english ASCII characters) and everything began working!