- 论坛徽章:
- 46
|
也就是说, 缺省的处理既不同于单行, 也不同于多行?
nhw_cs 发表于 2011-11-10 12:56 ![]()
m
Treat string as multiple lines. That is, change "^" and "$" from matching the start or end of the string to matching the start or end of any line anywhere within the string.
s
Treat string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match.
Used together, as /ms, they let the "." match any character whatsoever, while still allowing "^" and "$" to match, respectively, just after and just before newlines within the string. |
|