Crash with jit.str.regexp (with commas)


    Jul 24 2006 | 9:59 pm
    Hi,
    I'm trying to find a way to remove some html tags with jit.str.regexp.
    With [jit.str.regexp @re /()/ @substitute " "] I can remove the tags, but I have a problem with commas: commas split my text in many lists...
    What is the magic formula to keep the commas ?
    Replacing all commas by "backslash comma" ( [,] --> [,] ) ?
    I tried this:
    max v2;
    and I have a fabulous crash...
    What is wrong ?
    Is it a bug ?

    • Jul 25 2006 | 4:46 pm
      Thanks, I can confirm. Looks like jit.str.regexp needs some tuning up
      to catch up with the vanilla regexp object.
      jb
      Am 24.07.2006 um 14:59 schrieb Thomas Goepfer:
      > With [jit.str.regexp @re /()/ @substitute " "] I can remove
      > the tags, but I have a problem with commas: commas split my text in
      > many lists...
    • Jul 25 2006 | 9:44 pm
      I made 3 mistakes:
      1) the box message should be [Hello, the, world], not [Hello, the, world]...
      2) I should replace comma by [\,] not [,]
      3) the syntax in jit.str.regexp seems wrong: [@re /(,?)/] crashes Max, but [@re /(,)/] works. (With the Max object "regexp", I have no crash, the first returns no result, but the second works fine))
      I'm not very good in perl, and I don't know why the first expression is bad.
      But the crash...!
      This is a good patch :
      max v2;