Forums > MaxMSP

Extract one line from "jit.str.regexp"

December 7, 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. –

December 7, 2010 | 7:05 pm

Edit->Copy Compressed


December 7, 2010 | 7:09 pm

Thanks, amended!



MIB
December 7, 2010 | 7:25 pm

one way:

– Pasted Max Patch, click to expand. –

December 7, 2010 | 7:35 pm

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

Thanks for your help so quickly!


December 7, 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. –

-Ben



MIB
December 7, 2010 | 11:28 pm

regexp gives me headaches!! ;)


December 8, 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!

Sam


December 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.

Thanks,
Paba


February 2, 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

Sam


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