0

这按预期工作

    <category>
     <pattern>DO NOT CALL ME *</pattern>
     <that>WHAT CAN I CALL YOU</that>
     <template>So what can I call you?</template>
    </category>

这会引发一个不匹配的错误

    <category>
      <pattern>DON'T CALL ME *</pattern>
      <that>WHAT CAN I CALL YOU</that>
      <template>So what can I call you?</template>
    </category>

我显然在做一些愚蠢的事情。有谁知道什么?

4

1 回答 1

1

您收到该错误是因为'没有转义,所以 Python 认为字符串在那里结束。尝试通过添加斜线
来转义。'\'

于 2017-03-06T10:43:59.863 回答