php正则表达中求教,该如何处理

WBOY
Release: 2016-06-13 10:07:55
Original
757 people have browsed it

php正则表达中求教
正则表达式边界符//
现在有一个正则表达式,我发现在表达式中有\A和\Z,请教这个\A和\Z 是什么意思?
如:$pattern = "/\A(.*)\Z/";

------解决方案--------------------
\b(b是一个字母)
代表单词的开头或者结尾,也就是单词的分界出
也就是说这个正则要匹配 AbbbZ,以A开头Z结尾的单词
------解决方案--------------------
他能够匹配

'\Aabcde\Z';

'AabcdeZ';

这样明白了否?
------解决方案--------------------
第一个 \A 表示必须以A字母为开头
第二个 \B 表示必须以B字母为结尾
的字符串~(纯属混分..)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!