perl脚本中匹配替换
发布时间:2020-12-15 21:00:07 所属栏目:大数据 来源:网络整理
导读:???????????????? ################################################################## ???????????????? # shao.bing take off dial_prefix+prefix_dial from $CLphone_number ???????????????? #######################################################
???????????????? ##################################################################
???????????????? # shao.bing take off dial_prefix+prefix_dial from $CLphone_number ???????????????? ################################################################## ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$stmtA = "SELECT dial_prefix FROM vicidial_campaigns where campaign_id = '$CLcampaign_id';"; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthA->execute or die "executing: $stmtA ",$dbhA->errstr; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthArows=$sthA->rows; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?if ($sthArows > 0) ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?@aryA = $sthA->fetchrow_array; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?? $dial_prefix?? ?=?? ??? ??? ?$aryA[0]; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? } ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthA->finish(); ?? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$stmtA = "SELECT prefix_dial FROM system_settings ;"; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthArows=$sthA->rows; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?if ($sthArows > 0) ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?{ ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?@aryA = $sthA->fetchrow_array; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?? $prefix_dial?? ?=?? ??? ??? ?$aryA[0]; ?? ??? ??? ??? ??? ??? ??? ??? ??? ??? ? } ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$sthA->finish();?? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$PREFIX = $dial_prefix.$prefix_dial; ?? ??? ??? ??? ??? ??? ??? ??? ??? ?$CLphone_number =~ s/$PREFIX//g; ##这里是用空格匹配替换到?$CLphone_number中$PREFIX 例子: $a="fffff'dddddd"; $a =~ s/'//g; print $a; #fffffdddddd(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |