backslash in macro with gnu.regexp not possible
Submitted by Sunday, 28 November, 2004 - 17:36
on
Trying to write a macro for removing empty lines I found that the beanshell interpreter breaks on the regular expression definition
String blankLine = new String("^\s$");
This is very annoying because working with regular expressions without backslash is simply impossible.
Error reads:
Sourced file: /home/kister/.jedit/macros/Shrink_Blank_Lines.bsh Token Parsing Error: Lexical error at line 18, column 41. Encountered: "\\" (92), after : "\'^":
Versions are: jedit 4.2 final on Linux and Blackdown JDK 1.4.1
Any help would be highly recommended.
Ulf Kister
String blankLine = new String("^\s$");
This is very annoying because working with regular expressions without backslash is simply impossible.
Error reads:
Sourced file: /home/kister/.jedit/macros/Shrink_Blank_Lines.bsh Token Parsing Error: Lexical error at line 18, column 41. Encountered: "\\" (92), after : "\'^":
Versions are: jedit 4.2 final on Linux and Blackdown JDK 1.4.1
Any help would be highly recommended.
Ulf Kister