/^/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|
随机推荐
- Candies
Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 30247 Accepted: 8409 Descrip ...
- js框架:vue
vue是一套用于构建用户界面的渐进式框架,vue被设计为可以自底向上逐层应用,核心库只关注图层 待续.......
- Python小世界:匿名函数、高阶函数、推导式
前言 木子本人搞起Python已有多年,一直觉得什么都会,但是有时候实操起来,才觉得很多底层基础的知识都没有彻底的灵活掌握. 另外,网上关于Python基础知识的各种普及已有太多太多. 附上相关大神的 ...
- Windows服务器初始配置
系统状态是否良好 检查ip地址.子网掩码等配置 防火墙是否关闭 是否有攻击,有多大的攻击,什么类型的攻击,攻击流量图 是否中病毒 1.改端口 (1)打开注册表 [HKEY_LOCAL_MACHINE\ ...
- $("body").animate({"scrollTop":top})无效的问题
问题 我在个人站点的左下角和右下角各自使用了如下代码来将页面滚动到顶部和底部: $("body").animate({scrollTop:0},800); $("body ...
- [Android]四大组件的运行状态
Activity的主要作用是展示一个界面并和用户交互,它扮演的是一种前台界面的角色. Service是一种计算型组件,用于在后台执行一系列计算任务.Service有两种状态:启动状态和绑定状态.启动状 ...
- C++文件操作方法小结
- 获取文件句柄 - fopen, fclose fopen(filename, opentype): 按照opentype的方式打开指定文件,打开失败返回NULL,否则返回文件句柄. 打开类型的属性 ...
- gedit配置
编辑 \(\rightarrow\) 首选项 \(\rightarrow\) 插件 \(\rightarrow\) 外部工具 启用 进入工具 \(\rightarrow\) Manage Extern ...
- UML类图学习总结
1.首先来认识下类图?以及类图的作用 类图(Class diagram)由许多(静态)说明性的模型元素(例如类.包和它们之间的关系,这些元素和它们的内容互相连接)组成.类图可以组织在(并且属于)包中, ...
- shell 发送Post请求,并获取状态码
#!/bin/bash aa=$ result=$(curl -H "Content-type: application/json" -X POST -o /dev/null -s ...