以外的任何字符

Any character other than

我已经为 ocamllex let non_line_termination_character = [^ '\x0D' '\x0A'] 定义了一个标记,它代表除 '\x0D''\x0A'.

之外的任何字符

现在,我想将它翻译成 sedlex。

有谁知道如何正确翻译吗?我应该使用 SUB(例如 SUB(SUB(any, '\x0D'), '\x0A') 还是 SUB(any, ('\x0D' | '\x0A')))?

这对应于 sedlex 文档中描述的 Compl

Compl  ('\x0D' | '\x0A')

另请参阅 https://github.com/ocaml-community/sedlex/blob/master/examples/complement.ml 中的示例。