I am using Str.regexp in OCaml to detect double semicolons or or and and symbols among other things, but a lot of the regexes aren't working as intended. For example,
Str.string_match (Str.regexp "\|\|") ";;" 0
returns true. You have to escape a character like '|', so I used "\|\|" as my regex instead of "||". However, I heard you might have to escape twice and write "\\|\\|" in Ocaml, yet this did not work either. So what am I supposed to do? Rubular thinks the Regex should work, but this is Ocaml and not Ruby, so I might've missed some subtle language difference.