我有这个正则表达式有效:
Str.string_match (Str.regexp "[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]") dir 0
Run Code Online (Sandbox Code Playgroud)
但我想简化它,它根本不起作用
"\\d{4}\\.\\d{2}\\.\\d{2}"
Run Code Online (Sandbox Code Playgroud)
还有其他的尝试使它工作,但我得出的结论是它有d,{}甚至与分组字符()的麻烦这种模式工作在任何其他语言,甚至在这个庞大的示例列表中使用http ://pleac.sourceforge.net/pleac_ocaml/patternmatching.html
有任何想法吗?谢谢