|
Boost Users : |
From: Richard Hadsell (hadsell_at_[hidden])
Date: 2007-01-26 18:59:01
I am having a problem with a regex_match in Boost 1.33.0. Perhaps I am
missing something; perhaps it is a bug that has been fixed.
The pattern "[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([Ee][+-]?\\d+)?" should match
only floating-point numbers that can be read by sscanf. (Extra escape
characters are for C++, of course.) Yet regex_match returns true for
"3.6.5".
I guessed that the problem might be in the '(...)?' expression just
before the alternative operator '|', so I tried this:
"[+-]?(\\d+|\\d+\\.\\d*|\\.\\d+)([Ee][+-]?\\d+)?". With this pattern
regex_match returns false for "3.6.5". I am using it, but I consider it
a workaround.
Can someone explain what I have missed or whether this is a bug?
-- Dick Hadsell 914-259-6320 Fax: 914-259-6499 Reply-to: hadsell_at_[hidden] Blue Sky Studios http://www.blueskystudios.com 44 South Broadway, White Plains, NY 10601
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net