So \s+$ includes both trailing spaces and tabs, right?
That's right. It's the same as [:blank:]+$
- but this latter syntax, the so called POSIX notation, is not always supported.
What's the different with [ \t]+$
No difference again, although \s would theoretically match any other blank characters, if they existed
The real difference is in what a particular application supports. I've just found out for example that TotalCommander supports \s, but for some reason does not seem to understand \t - even though the help file says it does. I'll try again and report a bug if confirmed.
Another area where apps differ is in the interpretation of line breaks. In TextPad, a linebreak is \n, so the regex could also be written as[ \t]+\n
and you would replace that with\n
In other text editors though \n may only mean the newline character. As you may know, in DOS and Windows the linebreak actually consists of two characters: caret return and new line. So some apps require you to spell them out:[ \t]+\r\n
and you would replace that with\r\n