来自http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html:
\Z The end of the input but for the final terminator, if any
\z The end of the input
Run Code Online (Sandbox Code Playgroud)
但这在实践中意味着什么?当我使用\ Z或\ z时,你能举个例子吗?
在我的测试中,我认为这"StackOverflow\n".matches("StackOverflow\\z")将返回true并"StackOverflow\n".matches("StackOverflow\\Z")返回false.但实际上两者都是假的.哪里出错了?
你有边界匹配器 "\G"` 的任何有用的例子吗?请给我一些真实世界的例子。Java 源代码表示赞赏。从“掌握正则表达式。Jeffrey EF Friedl”我得到了一个解析 HTML 的有用示例,但我不确定是否可以翻译成 Java。