As mentioned, %[^\n] means "get everything that isn't a newline". If you do that, well, the newline is still there since you got everything that wasn't a newline. You need to now do something with...