cut words, keep others


    Nov 01 2008 | 12:02 pm
    Hello,
    I have this message:
    qwe
    I'd like to cut "qwe" and keep
    How can I do that?
    Thank you.

    • Nov 01 2008 | 12:15 pm
      On 1 nov. 08, at 13:02, Derrick Giscloux wrote:
      > Hello,
      >
      > I have this message:
      >
      > qwe
      >
      > I'd like to cut "qwe" and keep
      >
      > How can I do that?
      It depends: [route qwe], [zl filter qwe].
      ej
    • Nov 01 2008 | 1:38 pm
      No sorry,
      qwe could be anything as well as
      In fact I want to keep what is inside <>
      I had a look at [detox] but the tag is invalid.
      The structure of the messages I want to process is:
      something
      I just want to keep
      Is it clear?
    • Nov 01 2008 | 2:10 pm
      On 1 nov. 08, at 14:39, Derrick Giscloux wrote:
      > Is it clear?
      yep. regexp is the way to go.
      ]+> means: you look for the character ' number ('+') of character which is not '>' ([^>] is a negative class),
      followed by a '>'.
      HTH,
      ej
    • Nov 01 2008 | 2:56 pm
      this is easy to achieve with the c-string functions externals in my
      collection, here just one way of doing this:
      hth
      /*j
    • Nov 01 2008 | 4:13 pm
      Thanks!
      It is great .. but ... I am still on 4.6.3
      Could you post a screen capture?
    • Nov 01 2008 | 4:19 pm
      On 1 nov. 08, at 17:13, Derrick Giscloux wrote:
      > Thanks!
      > It is great .. but ... I am still on 4.6.3
      >
      > Could you post a screen capture?
      Just use:
      regexp ]+>
      and take the third outlet (substrings).
      ej
    • Nov 01 2008 | 5:01 pm
      how about a message box with a $2 in it?
    • Nov 01 2008 | 6:33 pm
      here's a patch for 4.x.x
      /*j
      > It is great .. but ... I am still on 4.6.3
    • Nov 01 2008 | 7:39 pm
      Once again a win for regular expressions.
      Can someone please refresh my memory; are there any maxMSP-specific
      tutorials going *DEEP* into regexp use?
      I know there are books and websites and such dealing with regular
      expressions on the whole, but something specific to max, going above and
      beyond the help files would really be killer.
      Perhaps as an article on cycling74.com? (if it isn't there already... ahem.)
      Cheers,
      Andreas.
      Emmanuel Jourdan skrev:
      > Just use:
      >
      > regexp ]+>
      >
      > and take the third outlet (substrings).
      >
      > ej
      >
    • Nov 01 2008 | 8:11 pm
      On 1 nov. 08, at 20:39, Andreas Wetterberg wrote:
      > Once again a win for regular expressions.
      >
      > Can someone please refresh my memory; are there any maxMSP-specific
      > tutorials going *DEEP* into regexp use?
      >
      > I know there are books and websites and such dealing with regular
      > expressions on the whole, but something specific to max, going above
      > and beyond the help files would really be killer.
      >
      > Perhaps as an article on cycling74.com? (if it isn't there
      > already... ahem.)
      It's complicated to document such kind of thing, as you said, there
      are already tons of awesome book on the subject (I highly recommend
      "Mastering Regular Expression" from Jeffrey Friedl, O'Reilly). Note
      that in the regexp's help file of Max 5 there's a few more concret
      examples.
      There's no dedicated regexp article, but you can find some funny one
      here, which will give you some ideas about what you can do:
      ej
    • Nov 01 2008 | 8:53 pm
      I think you guys are thinking about this too hard.
      If it's just a 2-element list like:
      qwe asd
      and you want to turn that into:
      asd
      then all you have to do is put it through a message box with $2 in it, to take the second element of the list. If it's not already a list (i.e. if it's a symbol) then just put it through a fromsymbol object first.
      If the list might sometimes be longer than two elements, then just simply use a zl object. For instance, if the list is:
      qwe asd fqu ajl qke rjrjrjrjr 0 0 2134.3
      and you want to turn that into:
      asd fqu ajl qke rjrjrjrjr 0 0 2134.3
      then just put it through a [zl slice 1] object, and take the output of the second outlet. Again, if the initial message is in symbol form, just run it through a fromsymbol object.
    • Nov 01 2008 | 9:00 pm
      On 1 nov. 08, at 21:53, Scott wrote:
      > I think you guys are thinking about this too hard.
      Unless I'm mistaken what Derrick wants is to find elements which start
      with a ''.
      ej
    • Nov 05 2008 | 8:06 pm
      Yes ej.
      anyway thanks to all.