📄 conver~1.pl
字号:
#!/usr/bin/perl -w# convert configfile from older version of modlogan (prior 0.5.5) to the new# pcre matching/grouping rules## usage:# $ ./convert_to_055.pl < modlogan.conf > modlogan.conf.new# $ mv modlogan.conf.new modlogan.conf# use strict;sub t { my ($s) = @_; $s =~ s/\./\\./g; if ($s =~ /^\*/) { $s =~ s/^\*//; } else { $s = "^".$s; } if ($s =~ /\*$/) { $s =~ s/\*//; } else { $s .= "\$"; } $s = "\"".$s."\""; return $s;}while (<>) { if ((/^grou/ && !(/^grouping/))|| /^hid/ || /^match/ || /^pagetype/) { if (/^(group.*)=(.+),(.+)$/) { print "# S ".$1." = ".$2.",".$3."\n"; print $1." = ".(t($2)).",".$3."\n"; } elsif (/^((hid|match|pagetype).*)=(.+)$/) { print "# M ".$1." =".$3."\n"; print $1." = ".(t($3))."\n"; } else { print "# N ".$_; } } else { print $_; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -