Since we're just looking for one newline, maybe this could be replaced by:
<pre>
size_t length = strcspn(s, "\n\r");
return length != 0
       && (s[length-1] == '\n' || s[length-1] == '\r')
       && s[length] == '\0';
</pre>

so we don't have to go through the whole regular expression framework.