关 键 词:
关于php正则表达式的两点备注
1.processfor"greedy"
Bydefault,thequantifiersare"greedy",thatis,they
matchasmuchaspossible(uptothemaximumnumberofper-
mittedtimes),withoutcausingtherestofthepatternto
fail.Theclassicexampleofwherethisgivesproblemsisin
tryingtomatchcommentsinCprograms.Theseappearbetween
thesequences/*and*/andwithinthesequence,individual
*and/charactersmayappear.AnattempttomatchCcom-
mentsbyapplyingthepattern
/\*.*\*/
tothestring
/*firstcommand*/notcomment/*secondcomment*/
fails,becauseitmatchestheentirestringduetothe
greedinessofthe.*item.
However,ifaquantifierisfollowedbyaquestionmark,
thenitceasestobegreedy,andinsteadmatchestheminimum
numberoftimespossible,sothepattern
/\*.*?\*/
欢迎进入PHP开发资源论坛讨论。
相关文章
图文推荐
论 坛 资 源
·轻松了解十个重要的 MySQL客户启动选项
·细化解析:怎样修改 MySQL数据库中的密码
·解析:怎样在MySQL中获得更好的搜索结果
·怎样正确的解决 MySQL 中文模糊检索问题
·提高MySQL 查询效率的三个技巧
·PostgreSQL 数据库函数库
·Oracle 数据库函数库
·Oracle8数据库函数库
·php下sqlite开发心得
·关于Access数据库安全
·细化解析:怎样修改 MySQL数据库中的密码
·解析:怎样在MySQL中获得更好的搜索结果
·怎样正确的解决 MySQL 中文模糊检索问题
·提高MySQL 查询效率的三个技巧
·PostgreSQL 数据库函数库
·Oracle 数据库函数库
·Oracle8数据库函数库
·php下sqlite开发心得
·关于Access数据库安全
热门技术文档
·轻松了解十个重要的 MySQL客户启动选项
·细化解析:怎样修改 MySQL数据库中的密码
·解析:怎样在MySQL中获得更好的搜索结果
·怎样正确的解决 MySQL 中文模糊检索问题
·提高MySQL 查询效率的三个技巧
·PostgreSQL 数据库函数库
·Oracle 数据库函数库
·Oracle8数据库函数库
·php下sqlite开发心得
·关于Access数据库安全
·细化解析:怎样修改 MySQL数据库中的密码
·解析:怎样在MySQL中获得更好的搜索结果
·怎样正确的解决 MySQL 中文模糊检索问题
·提高MySQL 查询效率的三个技巧
·PostgreSQL 数据库函数库
·Oracle 数据库函数库
·Oracle8数据库函数库
·php下sqlite开发心得
·关于Access数据库安全
最新图文档
本站编辑推荐:(本站开通Delphi4PHP专区,欢迎进入论坛交流!)
- · 3分钟快速了解 Delphi for PHP 特色 (中文), PDF档
- · 购买Delphi for PHP的五大理由, PDF档
- · Delphi for PHP 使用规格介绍, PDF档
- · Delphi for PHP 問答集 (From CodeGear)
- · Delphi for PHP 产品价格表
编缉最近更新文章
网站赞助商
搜索您感兴趣的内容




