All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
入门知识:动态网页PHP编程中字符串5个技巧_[PHP教程]
《SQL,Server,2005技术内幕:T-SQl查询》:常见sql问题归类解答_mssql学习_编程技术
delphi列表视图组件(TListView)使用方法
制作网站前看看这些好的网页技术规范_[Html教程]
HTML 5 预览(4)_[Html教程]
ASP.NET中制作WEB统计图控件的捷径_[Asp.Net教程]
无废话C#设计模式之七:Adapter_.net资料_编程技术
XHTML 1.0:标记新的开端_[Html教程]
在PHP中全面阻止SQL注入式攻击之二_[PHP教程]
SQL,Server,2008-新位置感知数据类型_mssql学习_编程技术
Reading number is top 10 pictures
好身材能把衣服穿出3D效果
Fierce! China's special forces training the devil1
The money of more than 100 countries and regions4
邪恶搞笑内涵图
壮丽的云彩1
Sanya, hainan Haitian party feast promiscuity
一万二一支的万珂,用得真心肉疼。
王艳写真温柔如水1
Small QiShu -- ShuangShuangPan2
The terra-cotta warriors3
Download software ranking
Unix video tutorial1
Tram sex maniac 2 (H) rar bag7
The hero
Tram sex maniac 2 (H) rar bag1
Eclipse 4.2.2 For Win64
软件工程思想
Unix video tutorial17
Tram sex maniac 2 (H) rar bag16
Be there or be square
豪门浪荡史
aaa published in(发表于) 2013/12/21 22:35:43 Edit(编辑)
关于php正则表达式的两点备注_php资料_编程技术

关于php正则表达式的两点备注_php资料_编程技术

关于php正则表达式的两点备注_php资料_编程技术-你的首页-uuhomepage.com
  severaltipsaboutRegularExpressions
  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
  
  /\*.*?\*/
 小结:
  ?与/U有类似功能,但同时出现彼此抵消
  
  如下:
    $a="asdf/*asdfaldsfasdf*/asfdasldf;kfldsj*/asfddsaf";
  $pattern="/\/\*.*?\*\//";
  //$pattern="/\/\*.*\*\//U";
  //$pattern="/\/\*.*?\*\//U";
  preg_match($pattern,$a,$match);
  print_r($match);
  ?>
  
  2.Assertions
  \w+(?=;)
  
  matchesawordfollowedbyasemicolon,butdoesnotinclude
  thesemicoloninthematch,and
  
  foo(?!bar)
  
  matchesanyoccurrenceof"foo"thatisnotfollowedby
  "bar".Notethattheapparentlysimilarpattern
  
  小结:
  (?!)只前向判断匹配,如bar(?!foo),而(?!foo)bar没有意义
  (?




添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.