Regular Expressions?

How do I match a newline character "
" in a string?

I’m using TexField.getCharBounds to get the position of the last character in a line.
When is space I just match it with an empty string (" ") but with the newline character I didn’t have any luck…