\p{space}|\p{Hex}|\p{Digit}|转译符|\1|\g{-1}|[^ab]|/([^\d\D]+)/
小骆驼 第七章 漫游正则表达式王国
#!/usr/bin/perl
use strict;
use warnings;
$_ = 'ab \ cde f ghijk10.x12ln';
if(/d/){print "get!\n";}
if(/x/){print "get!\n";}else{print "no match!\n"}
if(/\p{space}/){print "get!\n";}else{print "no match!\n"}
if(/\p{Digit}/){print "get!\n";}else{print "no match!\n"}
if(/\p{Digit}\p{Hex}/){print "get!\n";}else{print "no match!\n"}
if(/\P{Digit}\p{Hex}/){print "get!\n";}else{print "no match!\n"}
if(/g.i/){print "get!\n";}else{print "no match!\n"}
if(/\./){print "get!\n";}else{print "no match!\n"}
if(/\\/){print "get!\n";}else{print "no match!\n"}
#get!
#no match!
#get!
#get!
#get!
#get!
#get!
#get!
#get!
$_ = 'aaaabbiaaccdd1122';
if(/(..)\1/){print "$1\n";}else{print "no match!\n"}
if(/(..)\1(.)\2i\1/){print "$1,$2\n";}else{print "no match!\n"}
if(/(.)\1(.)\211/){print "$1,$2\n";}else{print "no match!\n"}
if(/(.)\1(.)\g{-1}11/){print "$1,$2\n";}else{print "no match!\n"}
if(/(.)\1(.)\g{2}11/){print "$1,$2\n";}else{print "no match!\n"}
#aa
#aa,b
#no match!
#c,d
#c,d
if(/([^ab]+)/){print "$1\n";}else{print "no match!\n"}
if(/([ab]+)/){print "$1\n";}else{print "no match!\n"}
if(/([^\d\D]+)/){print "$1\n";}else{print "no match!\n"}
#i
#aaaabb
#no match!
\p{space}|\p{Hex}|\p{Digit}|转译符|\1|\g{-1}|[^ab]|/([^\d\D]+)/的更多相关文章
- java中转译符用"\\"的几种特殊字符
在使用split的方法进行分隔时,要对这几种特殊字符进行"\\"分隔 | * ^ : . 1."|" 示例: String[] splitAddress=add ...
- 转译符,re模块,random模块
一, 转译符 1.python 中的转译符 正则表达式中的内容在Python中就是字符串 ' \n ' : \ 转移符赋予了这个n一个特殊意义,表示一个换行符 ' \ \ n' : \ \ 表示取 ...
- JavaScript中的转译符
转译字符 含义 \o NUL字符(\u0000) \b 退格符(\u0008) \t 水平制表符(\u0009) \n 换行符(\u000A) \v 垂直制表符(\u000B) \f 换页符( ...
- Linux-编译器gcc/g++编译步骤
gcc和g++现在是gnu中最主要和最流行的c&c++编译器.g++是c++的命令,以.cpp为主:对于c语言后缀名一般为.c,这时候命令换做gcc即可.编译器是根据gcc还是g++来确定是按 ...
- Cognition math based on Factor Space (2016.05)
Cognition math based on Factor Space Wang P Z1, Ouyang H2, Zhong Y X3, He H C4 1Intelligence Enginee ...
- C#对HTML转译需要注意的问题
在做B/S程序时我们多少会用到一点HTML特殊符号转译. 如:“&”——>“&” , "<"——>"<" , " ...
- input框内的单引号,双引号转译
主要是在后台传前端之前先把变量值替换单引号双引号成转译付. $bianlian是要替换的变量 两种方法 1.php后台输出值先转译 //双引号替换成转译符 $bianlian=preg_replace ...
- System and method for critical address space protection in a hypervisor environment
A system and method in one embodiment includes modules for detecting an access attempt to a critical ...
- Latin1的所有字符编码
ISO-8859-1 (ISO Latin 1) Character Encoding Contents The characters at a glance Character codes and ...
随机推荐
- 2.25-2.26 MapReduce执行流程Shuffle讲解
原文链接:https://langyu.iteye.com/blog/992916 Shuffle过程是MapReduce的核心,也被称为奇迹发生的地方.要想理解MapReduce, Shuffle是 ...
- Windows下findstr命令的使用
命令:findstr 参数解释 /b 如果位于行的开头则匹配模式. /e 如果位于行的末尾则匹配模式. /l 使用文字搜索字符串. /r ...
- HDU 1230饭前开胃菜
题意不讲了.. 没思路,上去就是干.... 两个所谓要加的数直接存到数组,开一个标记的数组,然后直接加,乱搞一波,就好了. 细心一点. #include<iostream> #includ ...
- 黑客攻防技术宝典web实战篇:定制攻击自动化习题
猫宁!!! 参考链接:http://www.ituring.com.cn/book/885 随书答案. 1. 指出使用自动技巧在应用程序中枚举标识符时用到的 3 个标识符“触点”. (a) HTTP ...
- postman接口测试系列: 时间戳和加密
在使用postman进行接口测试的时候,对于有些接口字段需要时间戳加密,这个时候我们就遇到2个问题,其一是接口中的时间戳如何得到?其二就是对于现在常用的md5加密操作如何在postman中使用代码实现 ...
- linux虚拟机时间不准的问题
如果时区不准, 使用tzselect命令(timezone选择),选择北京时间.然后把输出的命令写入/etc/profile.d/time.sh里. 然后用crontab写定时任务,每天执行一次. 3 ...
- 洛谷1736(二维dp+预处理)
洛谷1387的进阶版,但很像. 1387要求是“全为1的正方形”,取dp[i][j] = min(dp[i-1][j-1], min(dp[i-1][j], dp[i][j-1]))吧?这个有“只有对 ...
- Ubuntu 安装 node
ubuntu安装node和npm的命令行命令: sudo apt install nodejs-legacy sudo apt install npm 最新版本安装方法 1.安装npm sudo ap ...
- DataGridView 绑定List<>数据的更新
使用BindingSource做为中间数据源,使用 bindingSource1.DataSource = productOrderList;dataGridView1.DataSource = bi ...
- Coco dfs 或者 状压dp。...
C -- Coco Time Limit:1s Memory Limit:64MByte Submissions:148Solved:85 DESCRIPTION Coco just learned ...