Forums > MaxMSP

Extract one line from "jit.str.regexp"

Dec 07 2010 | 7:00 pm

Hi there guys,

This is my first post, I have done some searching around and just cannot seem to get this patch working as I want. I’m sure it’s painfully simple, but i just can’t figure out how to do it. Essentially, i’m loading an XML file into a jit.textfile, then running a query for everything within tags. It’s working perfectly well, but it prints out all 20 results, ideally, i just want the first result. If anyone can help me, i’d be so grateful!

-- Pasted Max Patch, click to expand. --

Dec 07 2010 | 7:05 pm

Edit->Copy Compressed

Dec 07 2010 | 7:09 pm

Thanks, amended!

Dec 07 2010 | 7:25 pm

one way:

-- Pasted Max Patch, click to expand. --

Dec 07 2010 | 7:35 pm

Brilliant, That’s pretty much exactly what I need.

Thanks for your help so quickly!

Dec 07 2010 | 8:37 pm

You should be able to do this all in regexp. Something like this might do it too:

-- Pasted Max Patch, click to expand. --


Dec 07 2010 | 11:28 pm

regexp gives me headaches!! ;)

Dec 08 2010 | 12:46 pm

Thanks for your help guys, both methods seem to work. I have to say for now I agree with MIB, It’s giving me a headache, but I may have to look into it further at a later point in my project,

These forums are awesomely useful!

Thanks again!


Dec 11 2010 | 12:28 am

Hi Sam,

Could post the fixed patch? I am fairly new to max and not advanced enough to figure out the code posted here. I am a student trying to use weather xml data to match it up to sound. A basic example for pulling in xml data will be helpful.


Feb 02 2011 | 9:34 pm

Hi all,

Paba7: See Bens patch above (Copy the code, then in max create new from clipboard)

Ben: Is there any way to configure the regexp object to not output the final ‘‘ as it appears on the end of every string. Been racking my brains about this for ages!

Many Thanks


Oct 19 2015 | 2:17 pm

Did you find a way to do it Sammi02?
I am trying this also and I can’t figure out, Is it something to do with the gate ? If I print from gate I can see its all there, but I don’t know how to get all of it, in the message box it just displays the last line..

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

Forums > MaxMSP