gpt4 book ai didi

正则反编译器

转载 作者:行者123 更新时间:2023-12-03 18:23:57 24 4
gpt4 key购买 nike

我找到了这个正则表达式并想了解它。是否有任何正则表达式反编译器可以将以下正则表达式的内容翻译成文字?这真的很复杂。

$text =~ /(((\w)\W*(?{$^R.(0+( q{a}lt$3))})) {8}(?{print +pack"B8" ,$^Rand ""})) +/x;

最佳答案

Using 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;

我的解释如下:
  (                        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)

There are 2 blocks of Perl code, which must be analyzed independently.

In the first block:

$^R . (0 + (q{a} lt $3))

在这里, $^R is “最后一次成功 (?{ code }) 正则表达式断言的评估结果”,以及表达式 (0 + (q{a} lt $3))如果第三次捕获在 [b-z] 中,则给出 1 , 0 否则。

在第二个块中:
print +pack "B8", $^R and ""

它将先前的评估结果解释为 (big-endian) binary string, get the number, convert it to the corresponding character ,最后打印出来。

正则表达式一起查找每 8 个字母数字字符,然后处理 [b-z] 中的那些字符。作为二进制数字 1,否则为 0。然后将这 8 个二进制数字解释为一个字符代码,并打印出该字符。

例如,匹配字符串时将打印字母 'H' = 0b01001000
$test = 'OvERfLOW';

关于正则反编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6163767/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com