remove html tags with regexp


    Nov 12 2007 | 1:47 pm
    hello all
    I'm trying to remove html tags from messages using regexp. The patch below seems to work. But when the message doesn't contain any html tags, regexp doesn't pass it through. Does anyone know how I can get around this, so ALL messages with, or without html tags will pass through regexp?
    Thanks a lot.
    Jonathan

    • Nov 12 2007 | 1:56 pm
      On 12 nov. 07, at 14:47, jonathan wrote:
      > > hello all > > I'm trying to remove html tags from messages using regexp. The > patch below seems to work. But when the message doesn't contain any > html tags, regexp doesn't pass it through. Does anyone know how I > can get around this, so ALL messages with, or without html tags > will pass through regexp?
      You can simply use the unmatched outlet.
      ej
      #P window setfont "Sans Serif" 9.; #P window linecount 1; #P comment 219 131 239 196617 but this doesn't get output by regexp; #P message 160 132 60 196617 hello world; #P message 121 260 68 196617 hello world; #P newex 121 226 62 196617 prepend set; #P newex 121 192 219 196617 regexp (\\]+\\>) @substitute %0; #P message 140 107 201 196617 Music is not usually boring i>.; #P newex 121 161 51 196617 tosymbol; #P message 121 93 139 196617 Art is boring.; #P comment 261 92 239 196617 these two work , because they contain tags already; #P fasten 4 3 5 0 282 214 126 214; #P connect 5 0 6 0; #P fasten 7 0 2 0 165 148 126 148; #P connect 1 0 2 0; #P fasten 3 0 2 0 145 130 126 130; #P connect 4 0 5 0; #P connect 2 0 4 0; #P window clipboard copycount 9;
    • Nov 12 2007 | 3:30 pm
      Excellent - I spent all weekend trying to figure it out and never thought of using the unmatched outlet as well as the substitutions outlet.
      Thanks a lot.
      Jonathan