如何使用perl替换字符串
#! perl $string0 = "Hello world"; $string1 = "world"; $string2 = "onitroad"; $caseon = ""; $caseoff = ""; #如果不区分大小写,使用下面开关 $caseon = "(?i)"; $caseoff = "(?-i)"; # 使用正则表达式查找并替换 $string0 =~ s/$caseon$string1$caseoff/$string2/g; print "$string0\n";
日期:2020-04-11 23:04:32 来源:oir作者:oir