Re: Unexpected illegal backslash warning
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <20150527154320.GC12943@quoth> |
> I tried Str.split (Str.regexp "\\n\|\\r"), but I get an illegal backlash warning. > What is the correct way to write it ? How many slashes should I use ? Pehaps I should combine it with Str.quote ? String "\\n\|\\r" itself seems to be causing that issue. What about "\\n\\|\\r"? The "\|" is invalid escape sequence and unline in some other languages, in OCaml this does not default to be interpreted as basckslash and pipe. M. -- \f.(\x.f(xx))(\x.f(xx)) (lambda f: (lambda x: lambda: f(x(x)))(lambda x: lambda: f(x(x))))