Home  >  Article  >  Backend Development  >  正则表达式{}解决思路

正则表达式{}解决思路

WBOY
WBOYOriginal
2016-06-13 11:07:43854browse

正则表达式{}
{?\s*052DF14F-6F28-44A0-9130-294FDA6176EB\s*}?
求助这里的{}是什么意思,  一般的花括号里面值得是重复的字数
------解决方案--------------------
事实证明是不需要的

$s = 'aa{123}bb';<br />preg_match_all('/{.+}/', $s, $r);<br />print_r($r[0]);
Array
(
    [0] => {123}
)

这也是多模板引擎选择 {} 作为模板元素的标识的原因
不仅仅是 {} 很少出现在正文了,主要是书写的识别规则串很清爽
而 []、() 就不具备这个特点

Statement:
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
Previous article:smarty 新手Next article:php session_start的有关问题