in reply to Regex: Ignore \n in \S

While of course the correct solution is to use the correct regexp, any time you have a string which may or may not have an undesired newline at the end, chomp can fix the problem

As Occam said: Entia non sunt multiplicanda praeter necessitatem.