The limit is an implementation detail. The pattern is compiled into codes which are then interpreted, and it just happens that the codes are (usually) 16 bits, giving a range of 0..65535, but it uses 65535 to represent no limit and doesn't warn if you actually write 65535.
以及
The quantifiers use 65535 to represent no upper limit, so ".{0,65535}" is equivalent to ".*".
快速手动二进制搜索发现了答案,特别是65535:
这是讨论here:
以及
感谢以下评论的作者指出了一些问题:
在^{} 中有一个常量
^{pr2}$MAXREPEAT
,它保存了这个最大重复值:(@MarkkuK。和@hcwhsa)
相关问题 更多 >
编程相关推荐