\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 ...
随机推荐
- Android Service完全解析,关于服务你所需知道的一切(上) (转载)
转自:http://blog.csdn.net/guolin_blog/article/details/11952435 转载请注明出处:http://blog.csdn.net/guolin_blo ...
- pip 国内安装镜像源
转自: https://blog.csdn.net/xuezhangjun0121/article/details/81664260 pip国内的一些镜像 阿里云 http://mirrors.a ...
- Linux文件和目录的777、755、644权限解释
Linux文件和目录的权限 1.文件权限 在linux系统中,文件或目录的权限可以分为3种: r:4 读 w:2 写 x:1 执行(运行)-:对应数值0 数字 4 .2 和 1表示读.写.执行权限 ...
- 牛客国庆集训派对Day_7
A.Relic Discovery 题目描述 Recently, paleoanthropologists have found historical remains on an island in ...
- Vijos p1518河流 树形DP
https://vijos.org/p/1518 这题代码我基本是抄的,实在太难想了.但是也学到了一些东西. 比如:多叉树转二叉树存,这个细细一想,确实使得在dfs的时候,实现起来方便很多. 说一说具 ...
- P2676 超级书架
题目描述 Farmer John最近为奶牛们的图书馆添置了一个巨大的书架,尽管它是如此的大,但它还是几乎瞬间就被各种各样的书塞满了.现在,只有书架的顶上还留有一点空间. 所有N(1 <= N & ...
- Tomcat+Jenkins+SonarQube+SVN+Maven 集成自动化环境搭建(Windows10环境下)
说在前面的话: 从接到任务到完成共用了7天的时间.正常人用不到这个时间. 此时的功能表现是: 登录本地JenKins对项目进行构建,能够自动从SVN读取最新代码并按照Maven项目构建,构建完成能够自 ...
- 协程和I/O模型
1.协程: 单线程实现并发 在应用程序里控制多个任务的切换+保存状态 优点: 应用程序级别速度要远远高于操作系统的切换 缺点: 多个任务一旦有一个阻塞没有切换,整个线程都阻塞在原地 该线程内的其他的任 ...
- Array(数组)的基本方法
1.定义:var arr=new Array ("12" , "zhang") 2.简写:var arr=[ 12 , "zhang&quo ...
- ES6学习笔记(12)----Reflect
参考书<ECMAScript 6入门>http://es6.ruanyifeng.com/ Reflect 1.概述:Object对象的内部方法都能在Reflect中找到,同时Reflec ...