[Discuss] Regular expressions and Boolean logic
D. S.
news.observer at gmail.com
Sun Jul 15 14:32:08 PDT 2007
If CMake uses pcre (perl compatable regular expressions), then you
might look at a "zero-width negative look-ahead assertion", and see if
it fits your case. It is described in the perl regular expressions
(perlre) man page. Even if that worked, it would look messy. (But
then again, how many REs are readable at first glance?)
Maybe the boolean combination of regular expressions can be done in
CMake itself?
On 7/15/07, Alan W. Irwin <irwin at beluga.phys.uvic.ca> wrote:
> I have the following problem:
>
> CMake has the ability to make source distributions from all files in the
> source tree excluding those specified with a regular expression for the
> complete path+filename.
>
> Let's suppose that I want to put foo.pdf and bar.pdf in the distribution, but
> exclude all other *.pdf files. One way is to list out all
> the (numerous) specific *.pdf files in the source tree that should
> be excluded, but that is a pain.
>
> Is there a slick way to do it with regular expression syntax? In particular
> I need a regular expression that is the following Boolean combination of RE's:
>
> /.*\.pdf$/ AND NOT /.*foo\.pdf$/ AND NOT /.*bar\.pdf$/
>
> Can such a Boolean combination be done with regular expressions? Basically
> the infix operator "|" is the Boolean OR for regular expressions, but what
> is the equivalent regular expression (if any) for the Boolean AND and
> Boolean NOT?
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
> package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
>
More information about the Discuss
mailing list