/^/m|/$/m|\b|\B|$&|$`|$'|变量捕获|()?|(?:pattern)|(?<LABEL>PATTERN)|$+{LABEL}|(|)|\g{LABEL}
#!/usr/bin/perl use strict;
use warnings; $_=' $$ oinn &&&
ninq kdownc
aninp
kkkk'; if (/(.*)k\Z/){print "$1\n";}else{print "no match\n";} # kkk if (/^n(.*)/m){print "$1\n";}else{print "no match\n";} #inq kdownc if (/(.*\bn.n\b.*)/){print "$1\n";}else{print "no match\n";} #no match if (/.*(\Bn.n\B).*/){print "$& and $1\n";}else{print "no match\n";} #aninp and nin if (/\w*(i)\w*/){print "$& and $1 and $` and $'\n";}else{print "no match\n";} #oinn and i and
#
# $$ and &&& my $new_words =
'sewfbiurev214`7i074o//m,m]\[g
sw d
trp'; if ($new_words =~ /(.*)g$/m){print "$1\n";}else{print "no match\n";} #sewfbiurev214`7i074o//m,m]\[ my $test = (<> =~ /^sd(.*)/m );if ($test){print "right!,it is $1\n";}else{print "no match\n";} #sdkkk
#right!,it is kkk my $what = shift @ARGV;if ($new_words =~ /(.*)($what$)/m){print "right!,it is $1 and $2\n";}else{print "no match\n";} # perl test.pl g
# right!,it is sewfbiurev214`7i074o//m,m]\[ and g $new_words =~ /(.*)g$/m;$new_words =~ /(.*)s$/m;print "$1\n"; #sewfbiurev214`7i074o//m,m]\[ $new_words =~ /(.*q)?(.*)g$/m;print "$2\n"; #sewfbiurev214`7i074o//m,m]\[ $new_words =~ /(?:.*q)?(.*)g$/m;print "$1\n"; #sewfbiurev214`7i074o//m,m]\[ $new_words =~ /(?:.*q)?(|s)(.*)g$/m;print "$1 and $2\n"; #s and ewfbiurev214`7i074o//m,m]\[ $new_words =~ /(?:.*q)?(?:|s)(?<label>.*)g$/m;print "$+{label}\n"; #ewfbiurev214`7i074o//m,m]\[ $new_words =~ /(?:.*q)?(?<label2>(|s))(?<label>.*)g$/m;print "$+{label} and $+{label2}\n"; #ewfbiurev214`7i074o//m,m]\[ and s my $test2 = 'aavvbbssd';
$test2 =~ /^(?<word1>.)\g{word1}(?<word2>.)\g{word2}/m;print "$+{word2} and $+{word1}\n"; #v and a print "|$`<$&>$'|\n"; #|<aavv>bbssd|
随机推荐
- css border实现三角形
实现过程: 正常的border <div class="box"></div> .box { background: #ddd; width: 100px; ...
- ue4 delegate event
官网相关 https://docs.unrealengine.com/latest/CHN/Programming/UnrealArchitecture/Delegates/index.html wi ...
- VLAN-7-VTP处理及修订版本号
在VTPv1和VTPv2中,更新的过程开始于:交换机管理员在一台VTP服务器交换机上添加.删除或更新VLAN.当新的配置出现时,VTP服务器将旧的VTP修订版本号加1,并通告完整的VLAN配置数据库以 ...
- JAVAFX-1 开发应用
为什么用javafx? 写这个专题的目的,其实也是好玩,原来的熟悉的使用swing 来开发java中的gui程序,其实早就知道有javafx 这个东西的,一致没有时间的玩,最近有时间所以学习.这个专题 ...
- C# ExpandoObject用法
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...
- 牛客假日团队赛2 D.亲和数对
链接: https://ac.nowcoder.com/acm/contest/924/D 题意: 求在给定区间[start,end]内所有的亲和数对. 亲和数的定义:对于数对(A,B),如果A的除了 ...
- PHP全国省市区地址分割提取脚本程序
github地址: https://github.com/zmxfree/addressapart 比如将 浙江省杭州市江干区XX路X号 分割成 浙江省 杭州市 江干区 XX路X号,方便excel操作 ...
- 【aspnetcore】添加自定义json配置文件
打开program.cs文件,修改CreateWebHostBuilder方法: public static IWebHostBuilder CreateWebHostBuilder(string[] ...
- NetCore中使用Myrmec
NetCore中使用Myrmec Myrmec 是什么? Myrmec 是一个用于检测文件格式的库,Myrmec不同于其它库或者手写检测代码,Myrmec不依赖文件扩展名(在实际使用中,你的用户很可能 ...
- 记录一个修改application.properties时遇到的坑
有一个需求是会频繁修改配置文件中的常量,为了方便就会用unzip解压war包,修改propertites中的值后重新打war 包,部署,但是发现修改的值没有起作用,,一直在纠结...后来发现其实在编译 ...