Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-10-05 11:09:41


On Thursday 05 October 2006 18:44, Rene Rivera wrote:
> Johan Nilsson wrote:
> > Vladimir Prus wrote:
> >> On Wednesday 04 October 2006 23:14, Johan Nilsson wrote:
> >
> > [snip]
> >
> >>> Why not use MATCH on the output to remove whatever you want? Or am I
> >>> missing something?
> >>
> >> FWIW, I had no luck at all getting MATCH to work. I've tried:
> >>
> >> local x = [ SHELL "pkg-config --cflags libxml-2.0" ] ;
> >> echo "X : $(x) : X" ;
> >>
> >> local xs = [ MATCH "(.*)\\n" : $(x) ] ;
> >> echo "Xs : $(xs) : Xs" :
> >>
> >> and got:
> >>
> >> X : -I/usr/include/libxml2
> >>
> >>> X
> >>
> >> Xs : -I/usr/i : Xs
> >>
> >>
> >> and then I've tried just one slash before 'n' and got the same.
> >
> > It looks like MATCH doesn't support multi-line mode. In the BJam docs it
> > states that the MATCH regex should be an egrep pattern, and that doesn't
> > include \n.
>
> Well it does, or can be made to, in the always entertaining bjam way of
> having flexible string values. This should work (famous last words):
>
> local xs = [ MATCH "([^
> ]*)" : $(x) ] ;

Will this match \r, \n, both, or an arbitrary combination thereof? There's no
reason to expect SHELL runs on Unix only ;-)

Devil's advocate for this evening,
Volodya


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk