Boost logo

Boost-Build :

Subject: [Boost-build] MATCH regular expression issue
From: wash (admin_at_[hidden])
Date: 2011-02-13 02:38:14

Hash: SHA1

The documentation for MATCH (bjam builtin rules) states:

  "Matches the egrep(1) style regular expressions [...]"

This is not entirely accurate.

  if [ MATCH "12[.]0|12" : "11.0" ] { ECHO "version 12" ; } # does not echo
  if [ MATCH "12[.]0|12" : "12.0" ] { ECHO "version 12" ; } # does not echo
  if [ MATCH "(12[.]0|12)" : "12.0" ] { ECHO "version 12" ; } # echoes

egrep is command-line syntactic sugar for `grep -E' (extended regular
expression, specified in POSIX, aka ERE). The above behavior (aka the failure
to match w/o parens) does not match the behavior described by POSIX or
implemented by well known grep distros:

  wash_at_pegasus:~/boost$ egrep --version
  GNU grep 2.6.3

  Copyright (C) 2009 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

  wash_at_pegasus:~/boost$ echo "11" | egrep "12[.]0|12"
  wash_at_pegasus:~/boost$ echo "12.0" | egrep "12[.]0|12"
  wash_at_pegasus:~/boost$ echo "12.0" | egrep "(12[.]0|12)"

I do not understand why I need to add the parens in bjam. Is this a bug? Is this
intention? Either way, can we either change this behavior, or change the docs?

- --
Bryce Lelbach aka wash

Version: GnuPG v1.4.9 (GNU/Linux)


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at