The keyword matchworks with OCaml templates. The regular expression is not an OCaml pattern, it is a different type of pattern, so you are not using them match.
In the same Strmodule with the function regexpare the corresponding functions.
, ocamllex, , ( , ) idregex OCaml .
, , Str.
$ ocaml
OCaml version 4.01.0
# #load "str.cma";;
# let idregex = Str.regexp "[a-zA-Z]+[a-zA-Z0-9_]*";;
val idregex : Str.regexp = <abstr>
# Str.string_match idregex "a_32" 0;;
- : bool = true
# Str.string_match idregex "32" 0;;
- : bool = false
, OCaml. OCaml ocamllex. micmatch. , OCaml ( ), - micmatch.