On Wednesday 06 November 2002 3:17 pm, Lars Gullik Bj�nnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> | On Wednesday 06 November 2002 2:37 pm, Lars Gullik Bj�nnes wrote:
> >> Angus Leeming <[EMAIL PROTECTED]> writes:
> >> | Lars, I'd value some help.
> >> |
> >> | Attached is a small test code for the boost regex code.
> >> |
> >> | Regex search pattern: ^And
> >>
> >> try this: "^And.*"
> |
> | Thank you, Lars. Is there a flag I can pass to boost::regex_match that
> | enables "^And" to succeed? Not boost::match_any anyway.
>
> That is not really how regexps work...

The old code used to succeed with a partial match. This will give us the old 
behaviour back:

// A functor for use with std::find_if, used to ascertain whether a
// data entry matches the required regex_
struct RegexMatch
{
        RegexMatch(boost::regex const & regex) : regex_(regex) {}

        bool operator()(string const & data) {
                return boost::regex_search(data, match, regex_,
                                           boost::match_any);
        }

private:
        boost::regex const regex_;
        // We use regex_search so that we don't have to match the entire string
        // to succeed. In turn, regex_search needs this, although we don't
        // use it thereafter.
        boost::cmatch match;
};

>
> >> I hope you didn't use the lyx boost to compile with... we turn off
> >> exceptions.
> |
> | Ahhh. Of course I did ;-)
> | But anyway, that's really the whole point. The user can enter the RE from
> | the citation dialog. Should he be able to crash lyx by entering a crap
> | one?
>
> The boost::regex code has a lot of defines to handle compiling without
> exceptions, but I guess that is all it does. The code does not seem to
> allow using it well without exceptions... I'll have a go around on
> this...

Thank you Lars,
Angus

Reply via email to