I want to replace all blank lines and lines filled only with spaces/tabs using golangs regexp. I thought the following regexp should do the trick,
emptyLINE := regexp.MustCompile(`^\s*$`)
but was surprised, that the begin of line
^ and end of line
$ regexp tags do not work. They rather seem to signify the start/end of the whole string instead of just a line within the string, see
Am I missing something here?
Wiktors answer almost got me there, still I cannot remove all wanted lines: https://play.golang.org/p/1IpETpFKCU