Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2004-05-19 05:05:53


> Many thanks for your help and advice here. It helped me to solve my
> problem, the expression I was passing to the function was not valid.
> However, I have one more question. I know this is regular expressions
here,
> but why am I not allowed to use "*tart* instead of "(.*)tart(.*)".

Or you could use .*tart.*

Boost regex implements three types of patterns:

Perl regular expressions (what you get by default)
POSIX extended regular expressions.
POSIX basic regular expressions.

The latter two are available by passing the appropriate flags to the regex
constructor, for example:

boost::regex e("\(.*\)abc", boost::regex::basic | boost::regex::icase);

Is a case insensitive, POSIX basic expression.

In none of three supported grammars is *tart* a valid expression.

I assume you were wanting a wildcard for matching filenames? If so that's
on my list of things to implement as well, but there are two competing and
rather incompatible forms to choose from (Unix style wildcards, and MS-DOS
style), which muddies the waters somewhat.

John.


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