当前位置:网站首页>正则表达式(?:pattern)
正则表达式(?:pattern)
2022-06-29 02:23:00 【hello php】
//(?:pattern):取消当前的这个小括号的后向引用功能,
//即:后面的"\1"后向引用时候,引用的是"PHP"这个字符串,
//而不是"Chapter|Section"这个字符串(这个正则表达式中虽然有两个括号,但却引用的是"PHP")
$pattern = "/^(?:Chapter|Section) (PHP) \1 [1-9][0-9]{0,1}$/";
$str = "Chapter PHP PHP 21";
//后面的"\1"后向引用时候,引用的是"Chapter|Section"这个字符串中的某一个,
//而不是"PHP"这个字符串(这个是正常的后向引用)
$pattern2 = "/^(Chapter|Section) (PHP) \1 [1-9][0-9]{0,1}$/";
$str2 = "Chapter PHP Chapter 21"; 



边栏推荐
- QT basics tutorial: qstringlist
- Trigonometric function calculation
- 三角函数计算
- 字符串分段组合
- 对补wasm环境的一些测试
- 网上联系客户经理办理炒股开户安全吗?
- 扁平结构转换为树结构
- 高并发的理解与设计方案
- How to become a senior digital IC Design Engineer (6-7) digital IC Verification: debug skills
- [apprendre la programmation FPGA - 49 à partir de zéro]: vision - Comment la puce a - t - elle été conçue?
猜你喜欢
![[MySQL practice of high concurrency, high performance and high availability of massive data -9] - transaction concurrency control solutions lbcc and mvcc](/img/62/77c2274db4f92ad1d88901e149251c.jpg)
[MySQL practice of high concurrency, high performance and high availability of massive data -9] - transaction concurrency control solutions lbcc and mvcc

CTFHub-Web-密码口令-默认口令

Flex application: realize two rows and five columns of data, self-adaptive

Day10 enumeration class and annotation

Some tests on complementary wasm environment

The 10 most commonly used gadgets for waterfall project management can be built and used freely

Introduction to openresty

SystemVerilog structure (I)

Talk about the copyonwritearraylist of JUC
![[redis] set type](/img/97/0a83016e89316849c01072044f2124.png)
[redis] set type
随机推荐
Qt基础教程:数据类型与容器
What is the Valentine's Day gift given by the operator to the product?
计算矩形面积
String method exercise
大智慧手机股票开户哪个券商更安全更方便?
What is the dry goods microservice architecture? What are the advantages and disadvantages?
What is Mipi
Examen final de troisième année
Use code binding DataGridView control to display tables in program interface
How to become a senior digital IC Design Engineer (4-2) script: file read / write operation realized by Verilog HDL code
短视频平台常见SQL面试题,你学会了吗?
Why install an SSL certificate on a web site?
Some tests on complementary wasm environment
利用kubernetes资源锁完成自己的HA应用
How to become a senior digital IC Design Engineer (3-5) tools: Spyglass Technology
String output
The linkedhashset set makes the elements orderly without repetition
[從零開始學習FPGA編程-49]:視野篇 - 芯片是如何被設計出來的?
字符串长度
Ctfhub web password default password