不可以,试试这个表达式[^(var curtime)].*,另外可以参考http://blog.csdn.net/skywalker_only/article/details/17655221中的代码,自己运行试试

解决方案 »

  1.   

    匹配不上正确的是^(?!var)^.*Enter your regex:[^(var curtime)].*
    Enter input string to search: adfadsf
    I found the text "dfadsf" starting at index 1 and ending at index 7.
    看输出结果
      

  2.   

    匹配不上正确的是^(?!var)^.*Enter your regex:[^(var curtime)].*
    Enter input string to search: adfadsf
    I found the text "dfadsf" starting at index 1 and ending at index 7.
    看输出结果好吧,确实没有完全匹配,漏掉了a,不好意思