零宽断言"?<=exp"为什么在oro里用不了啊,不是说兼容perl5么?我看perl5里可以这么写啊.
谁有相关资料么?谢谢,着急等~

解决方案 »

  1.   

    (?<=类((\\s*)|[ ]*)(型|别)(:|:|\\s|[ ])).*
    java自带的库里可以用,但是oro里报错:
    org.apache.oro.text.regex.MalformedPatternException: Sequence (?<...) not recognized
    at org.apache.oro.text.regex.Perl5Compiler.__parseExpression(Unknown Source)
    at org.apache.oro.text.regex.Perl5Compiler.__parseAtom(Unknown Source)
    at org.apache.oro.text.regex.Perl5Compiler.__parseBranch(Unknown Source)
    at org.apache.oro.text.regex.Perl5Compiler.__parseAlternation(Unknown Source)
    at org.apache.oro.text.regex.Perl5Compiler.__parseExpression(Unknown Source)
    at org.apache.oro.text.regex.Perl5Compiler.compile(Unknown Source)
    at org.apache.oro.text.regex.Perl5Compiler.compile(Unknown Source)
      

  2.   

    你确定这个表达式在 Java 中是可用的?(?<=)(?<!)这两个在 Java 中的表达式是不允许是 * + 等不确定最大次数的量词。
      

  3.   

    to bao110908:
    你说的这个限制我知道,有的时候是会说必须要指定最大次数,但有的时候不会.但是用oro的库的问题是它根本不去识别"?<="我怀疑是不是有特殊的语法?但是?=是可以用的..而且oro号称是兼容perl5的正则表达式,而perl5我看的资料说是支持?<=和?=的..没道理只支持其中一个啊...