脚本之家,脚本语言编程技术及教程分享平台!
分类导航

Python|VBS|Ruby|Lua|perl|VBA|Golang|PowerShell|Erlang|autoit|Dos|bat|

服务器之家 - 脚本之家 - perl - 使用 use re debug 查看正则表达式的匹配过程

使用 use re debug 查看正则表达式的匹配过程

2020-06-11 11:09脚本之家 perl

使用 use re 'debug' 查看正则表达式的匹配过程,参见如下的代码

复制代码 代码如下:


#!/usr/bin/perl
use strict;
use warnings;
use re 'debug';
sub test {
    my $str = "123456789";
    print join(":", split /(?<=...)/, $str);
}
test();

延伸 · 阅读

精彩推荐