SoftTimur
SoftTimur

Reputation: 5510

Any character other than

I have defined a token for ocamllex let non_line_termination_character = [^ '\x0D' '\x0A'], which represents any character other than '\x0D' and '\x0A'.

Now, I would like to translate it to sedlex.

Does anyone know how to translate it correctly? Should I use SUB (e.g., SUB(SUB(any, '\x0D'), '\x0A') or SUB(any, ('\x0D' | '\x0A')))?

Upvotes: 1

Views: 85

Answers (1)

octachron
octachron

Reputation: 18892

This corresponds to Compl as described in sedlex documentation

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

See also the example at https://github.com/ocaml-community/sedlex/blob/master/examples/complement.ml .

Upvotes: 1

Related Questions