正则表达式反编译器

我找到了这个正则表达式,想要了解它.是否有任何正则表达式反编译器将以下正则表达式转换为单词?这真的很复杂.

$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,_) (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))

这里,$^R is“评估最后一次成功(?{code})正则表达式断言的结果”,表达式(0(q {a} lt $3))如果第三次捕获在[bz]中则给出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';

相关文章

正则替换html代码中img标签的src值在开发富文本信息在移动端...
正则表达式
AWK是一种处理文本文件的语言,是一个强大的文件分析工具。它...
正则表达式是特殊的字符序列,利用事先定义好的特定字符以及...
Python界一名小学生,热心分享编程学习。
收集整理每周优质开发者内容,包括、、等方面。每周五定期发...