I'm trying out Reason and I'm trying to use a regex, but nothing is matching. AFAIK Reason doesn't have any specific regex related things so I'm just going off the OCaml documentation.
My string looks like:
let name = "const {foo} = bar";
And the regex I'm using is
let re = Str.regexp_string "\\bfoo\\b"
try {
Str.search_forward re name 0;
/* do something */
} {
| Not_found => acc
}
But I'm not getting any matches. Can anyone help?
Edit: For reference, the regex docs for OCaml can be found at https://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html. I was using http://pleac.sourceforge.net/pleac_ocaml/patternmatching.html as an example for OCaml regexes I can't get it to work.
"\\bfoo\\b"with no slash at the end? - Wiktor Stribiżew