title: Dollar sign in regular expression and new line character
body: <p>I know that the dollar sign is used to match the character at the end of the string, to make sure that search does not stop in the middle of the string but instead goes on till the end of the string.</p>
  
  <p>But how does it deal with the newline character, does it match just before the new line character or does it take that into account.</p>
  
  <p>I checked it in eclipse regex, for a regex matching array of strings 
  <code>([A-Za-z ]+)$\n</code> worked, not the other way around <code>([A-Za-z ]+\n)$</code></p>