Matching numbers at the beginning of a string?

"[email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
I was expecting a true while trying to match 6 numbers from the beginning of string, instead i am getting a false.
What is wrong with this regular expression?

utop # Str.string_match (Str.regexp "^\\d{6}") "122323" 0 ;;
- : bool = false  
 

 The following works, but  that is not  exactly i am looking for.
 

 utop # Str.string_match (Str.regexp "^[0-9]+") "122323" 0 ;;
- : bool = true 

 

 Cheers.
 - jo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.