Really green here. I am trying to get a regex that works in Notepad++ to run in Java using BlueJ, but Java seems to be ignoring it. I am using other replaceAll functions using regular expressions, and all of those are working.
I have this, but it is telling me the \s is an illegal escape character:
itemList[i] = itemList[i].replaceAll("^(\s*\r\n){2,}", "\r\n");
I read about the Java engine and changed the \s to \s so it wasn't illegal:
itemList[i] = itemList[i].replaceAll("^(\\s*\r\n){2,}", "\r\n");
I tried using [[:space:]] instead, however, it still doesn't do the replace function.
itemList[i] = itemList[i].replaceAll("^([[:space:]]*\r\n){2,}", "\r\n");
This Java tool is processing hundreds of lines, and people are having issues using Notepad++ to remove the duplicate lines. I thought maybe doing it in the formatting tool would eliminate the issues. Here is an example of the text:
1. Modification: No Error Message When SQL Server Down
S9# 395
Summary
No error message when the SQL Server is
down.
Workaround
There is currently no
workaround for this issue. The system will become
unusable if SQL server is down.