“keys %+"是什么意思?在 perl 中? [英] What is the meaning of the "keys %+" in perl?

查看:54
本文介绍了“keys %+"是什么意思?在 perl 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简短问题:

keys %+

在 perl 中?

我在一些源代码中看到了它.

I saw it in some source code.

推荐答案

散列 %+ 具有当前范围内正则表达式中命名捕获组的所有匹配项.它在 perlvar 下的 %LAST_PAREN_MATCH 中有解释,并在 5.10 中添加.

The hash %+ has all the matches from named capture groups in regexes in the current scope. It's explained in perlvar under %LAST_PAREN_MATCH and was added in 5.10.

类似于@+,%+ 哈希允许访问命名捕获缓冲区,如果它们存在,在最后一次成功的匹配中当前活动的动态范围.[..]

Similar to @+ , the %+ hash allows access to the named capture buffers, should they exist, in the last successful match in the currently active dynamic scope. [..]

keys 函数列出了哈希.

The keys function lists all the keys in the hash.

这篇关于“keys %+"是什么意思?在 perl 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆