Boost logo

Boost :

From: Michael Goldshteyn (mgoldshteyn_at_[hidden])
Date: 2005-02-18 08:55:08


Why can I not construct a regex of the form: "|abc" (throws exception based
on REG_EMPTY) for use with regex_match, if I want to match either "abc" or
the empty string "". I understand thatn in a regex_search the empty string
would always match (per Perl like semantics), and abc would never be
considered. But, I want to use this with regex_match, where the empty string
would have to match the entire string being searched. Work arounds such as
"(?:)|abc" and "^$|abc" seem to get around this deficiency, but I am
wondering why it is there in the first place.

Thanks,

Michael Goldshteyn


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk