daspostloch wrote:
I have been writing regexes for a long time :-).
\s stands for "whitespace character". Again, which characters this actually includes, depends on the regex flavor. In all flavors discussed in this tutorial, it includes [ \t\r\n].
I just tried it out with Perl and Python (two langauges I rarely use) and found their behaviour to be the same as that of Geany.
My main use of regexes was actually in the Nedit editor and I had somehow come to assume that Nedit regexes were the standard when obviously this isn't the case.
So it will eat the spaces and the next \n, etc as well. Hence try " +$" , which works for me.
Yes, that does work as long as the trailing whitespace is only spaces. It doesn't work if its a mixture of tabs and spaces. For that something like "[ \t]+$" is required which is a little less convienient than what I was used to, but I'm sure I can learn to live with it.
Cheers, Erik