Home >Backend Development >PHP Tutorial > 求几个正则解决办法

求几个正则解决办法

WBOY
WBOYOriginal
2016-06-13 13:16:55845browse

求几个正则
我想求下面三个的PHP preg正则:
一、{cms.cfg.abc}---{cms. 和}是固定的 {cms.*.*}

二、{cms:list order='orderid desc'}模板内容{/cms:list}
  order='orderid desc' 是这个标签的属性列表.可有可无,也可能是多个如:
  {cms:list order='orderid desc' table='abc'}>模板内容{/cms:list}
  {cms:list}>模板内容{/cms:list}

三、{cms:include file='1.html'} 这样的

求上面三个的正则..
最近没分了..以后分灌水区放分

------解决方案--------------------
2、 /\{cms:([^: ]*)[^}]*\}.*\{\/cms:\1\}/
3、/\{cms:[^}]*\}/

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