it is rarely used to intentionally do what it actually does (match either the end of the string or before a newline at the end of a string). If your data has no newlines, use
at the end of the string). If your data ends with newlines, use
if your string may have internal newlines that should not match). Then your code doesn't mislead about what the data looks like.