Reputation: 747
If I have text:
AAAAAA
BBBBBB
CCCCCC
DDDDDD
EEEEEE
FFFFFF
GGGGGG
HHHHHH
I want to match all end of line except the blank lines and replace the end of line to tab. [^\s]$
partly works, but it also matches the last character of non-blank line. [^^]$
does not work. What is the correct regex?
Upvotes: 3
Views: 804
Reputation: 13640
You can use lookbehind for this purpose:
(?<=[^\s])$
See DEMO
Upvotes: 2