我找到了这个正则表达式,想要了解它.是否有任何正则表达式反编译器将以下正则表达式转换为单词?这真的很复杂.
$text =~ /(((\w)\W*(?{$^R.(0+( q{a}lt$3))})) {8}(?{print +pack"B8" ,$^Rand ""})) +/x;
Run Code Online (Sandbox Code Playgroud)
ken*_*ytm 17
使用YAPE::Regex::Explain(不确定它是否好,但它是搜索的第一个结果):
use YAPE::Regex::Explain;
my $REx = qr/(((\w)\W*(?{$^R.(0+( q{a}lt$3))})) {8}(?{print +pack"B8" ,$^Rand ""})) +/x;
my $exp = YAPE::Regex::Explain->new($REx)->explain;
print $exp;
Run Code Online (Sandbox Code Playgroud)
我的解释如下:
( group and capture to \1 (1 or more times
(matching the most amount possible)):
----------------------------------------------------------------------
( group and capture to \2 (8 times):
----------------------------------------------------------------------
( group and capture to \3:
----------------------------------------------------------------------
\w word characters (a-z, A-Z, 0-9, _)
----------------------------------------------------------------------
) end of \3
----------------------------------------------------------------------
\W* non-word characters (all but a-z, A-Z,
0-9, _) (0 or more times (matching the
most amount possible))
----------------------------------------------------------------------
(?{$^R.(0+( run this block of Perl code
q{a}lt$3))})
----------------------------------------------------------------------
){8} end of \2 (NOTE: because you are using a
quantifier on this capture, only the
LAST repetition of the captured pattern
will be stored in \2)
----------------------------------------------------------------------
(?{print +pack"B8" run this block of Perl code
,$^Rand ""})
----------------------------------------------------------------------
)+ end of \1 (NOTE: because you are using a
quantifier on this capture, only the LAST
repetition of the captured pattern will be
stored in \1)
有2个Perl代码块,必须单独分析.
在第一个块中:
$^R . (0 + (q{a} lt $3))
Run Code Online (Sandbox Code Playgroud)
这里$^R是 "评估最后一次成功的(?{ code })正则表达式断言的结果",(0 + (q{a} lt $3))如果第三次捕获是在[b-z],表达式给出1 ,否则为0.
在第二块:
print +pack "B8", $^R and ""
Run Code Online (Sandbox Code Playgroud)
它将以前的评估结果解释为(big-endian)二进制字符串,获取数字,将其转换为相应的字符,最后将其打印出来.
正则表达式一起找到每8个字母数字字符,然后将它们[b-z]视为二进制数字1,否则为0.然后将这8个二进制数字解释为字符代码,并打印出该字符.
例如,匹配字符串时将打印字母"H"= 0b01001000
$test = 'OvERfLOW';
Run Code Online (Sandbox Code Playgroud)