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.
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.
I checked it in eclipse regex, for a regex matching array of strings
([A-Za-z ]+)$
worked, not the other way around ([A-Za-z ]+
)$