首页 相关文章 关于php正则表达式的两点备注

关于php正则表达式的两点备注

  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

 ...[ 查看全文 ]

2016-02-19 标签:

关于php正则表达式的两点备注的相关文章

手机页面
收藏网站 回到头部