Parsing Text

May 24, 2011 at 8:20pm

Parsing Text


I’ve got a problem that to my mind should be kind simply to fix but after hours of searching can’t find anything.

Basically, my patch reads ID3 Tag data from an XML file, and splits it into individual lines that read like:

The Beatles


Is there anyway to get rid of the & parts. I’ve tried to do this with [sprintf] and [regexp] but am having no luck as MaxMSP reads it as one word.

Failing that is there a way it can be converted into numbers, something like unicode. As it’s use eventually will be to query a database.

Any tips would be great, cheers.

May 24, 2011 at 8:37pm

regexp should do the trick:

– Pasted Max Patch, click to expand. –

Not sure if it is of interest to you, but Jeremy Bernstein made a nice object for reading id3 tags, metatag:


May 24, 2011 at 9:16pm

Cheers Ben, that’s exactly what I wanted, just hadn’t got round to learning the regexp syntax.

Will also check out Jeremy Bernstein’s object, looks very relevant to my project.

May 24, 2011 at 9:49pm

Yeah, its a bit of a beast.

As far as learning the regexp syntax, here are a few useful ref links:

There are some nifty tutorials out there too. I remember reading through this one and finding it useful:


May 25, 2011 at 2:15pm

there’s also tap.xml.sax from Electrotap’s Tap.Tools objects, which saves having to learn any regexp and also maintains structure…


You must be logged in to reply to this topic.