Regular Expressions in field formatting

Help
linker3000
2013-11-21
2013-11-21
  • linker3000
    linker3000
    2013-11-21

    Hi,

    I am trying to format a multi-line text field in a report to remove blank lines. After a bit of reading I have come up with the following regular expressions but the editor won't accept them and it throws a syntax error. Am I even close!?

    $F{followups}.replace("/^\s*\n/gm", "")
    or
    $F{followups}.replace(/(\r\n|\n|\r)/gm,"")