我想知道perl特殊变量$-[0]
和$+[0]
的含义
我用Google搜索,发现$-
代表页面上剩余的行数,$+
代表由上一个搜索模式匹配的最后一个括号。
但是我的问题是$-[0]
和$+[0]
在正则表达式的上下文中意味着什么。
让我知道是否需要代码示例。
最佳答案
有关perldoc perlvar
和@+
的信息,请参见 @-
。
$+[0]
is the offset into the string of the end of the entire match.
$-[0]
is the offset of the start of the last successful match.
关于perl - perl特殊变量$-[0]和$ + [0]是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11186959/