How to remove the last \"\\n\" from a textarea?
You can do it this way (.*[^\n])\n* Result: https://regex101.com/r/lWKzFy/1
(.*[^\n])\n*