本帖最后由 ahui132811 于 2012-05-04 12:13:09 编辑

解决方案 »

  1.   

    http://perldoc.perl.org/perlretut.html#Looking-ahead-and-looking-behind
    这是perl的正则文档,觉得应该可以适用php的正则引擎
    里面有一句 The lookahead assertion is denoted by (?=regexp) and the lookbehind assertion is denoted by (?<=fixed-regexp)
    零宽断言也叫环视,上面的意思是逆序环视只能包含固定长度的子表达式,所以不能出现 * ? +这些量词,只有顺序环视可以
      

  2.   

    (?<=fixed-regexp) 多谢!看来只能用这个代替了:
    (?:regexp)preg_match('#(?:<(\w+)>).*(?=</\1>)#',' pre<a>hi!</a> word',$mt);
      

  3.   

    平衡组/递归匹配 
    在perl中也是没有的吧
      

  4.   

    perl中都有   php暂不支持平衡组