The . character in a php regex accepts all characters, except a newline. What can I use to accept ALL characters, including newlines?
.
It's the the . character that means "every character" (edit: OP edited). And you need to add the option s to your regexp, for example :
preg_match("`(.+)`s", "\n");