Remove last few characters from string

Sammio2's icon

Hi all,

Posted for help a while ago, on the same thing, but a different issue. Basically, i'm using the 'regexp' object to extract one line from an XML file, but for some reason the extraction includes the last set of brackets, i.e. .

Can anyone have a look at this, and see if there's an easy way to extract just the information within the brackets?

If anyone can help, i'd be very grateful!

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

Sam

Ben Bracken's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I'm actually not quite sure how to only get one backreference with regexp, but you could use one of many patching workarounds like this:

-Ben

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

You can use lazy quantifiers in regexp so you only select the part from flags.

Sammio2's icon

Thanks guys, you always come up with a solution!