Can I use named groups in a Perl regex to get the results in a hash?

后端 未结 4 2077
死守一世寂寞
死守一世寂寞 2020-12-30 00:12

Is it possible to perform a named-group match in Perl\'s regex syntax as with Python\'s? I always bind the $n values to proper names after matching, so I\'d fin

4条回答
  •  温柔的废话
    2020-12-30 00:58

    AFIK PCRE has named group capturing as:

    (?'NAME'pattern)
    (?pattern)
    

    You can find info here.

提交回复
热议问题