Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you are not in multi-line mode, then a single line is expected and consequently there is at most one newline at the end of the string. You can of course pick an input that violates this, run it against a multi-line string with several newlines in it. cat\n\n will not match cat$ because there is something between cat and the end of the line, it just happens to be a newline but without any special meaning because it is not the last character and you did not say that the input is multi-line.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: