Please treat `\n` as new line regardless of the line-endings of the file is Unix or Windows. `\n` works on other text editors I have used, e.g: JEdit. Only Geany requires me to use `\r\n` for files with Windows line-endings.
Related: #3959.
Note that the Perl regex language is widely standardised with `\n` being the newline character (and `\r` for carriage return). It is unlikely that a non-standard usage will be accepted.
You could check, perhaps there is another backslash that matches all different types of line ends, but it won't be `\n`.
Yes, I know. Google shows the result immediately. But do you think you want to remember such a mess?
https://www.npopov.com/2011/12/10/PCRE-and-newlines.html
But do you think you want to remember such a mess?
I want to remember what is the standard usage most other places, not what one outlier tool uses for the same syntax.
The regex syntax using `\n` as newline and `\r` as carriage return is a widely used regex standard in programming languages such as Perl, Javascript, c# etc and libraries such as PCRE, C++ ISO standard, .net and tools such as Vscode, Eclipse, grep, etc. The "mess" is some tool that uses a non-standard backslash that clashes with most other languages, libraries or tool usage.
Basically Geany is not going to use a non-standard regex syntax, it uses what the Glib library provides and matches the standard.
If you have files that use CRLF line end use `\r\n` as the search that you will replace with nothing.
If you can't remember that, or your file is the "mess" with mixed line ends, use `Document->Set Line Endings->Convert and set to LF` to make them all consistent then use `\n` as the search.
Closed #3964 as not planned.
github-comments@lists.geany.org