www.digitalmars.com         C & C++   DMDScript  

D.gnu - setup-gcc.sh: fails to match some gcc versions

The regular expressions used in setup-gcc.sh fail to match the BASE-VER
version used in raspbian's (debian for raspberry pi) gcc-4.7 package
source.

The BASE-VER content is "4.7", but the regex checks for "4.7.", so it
fails.
I'm not an regex expert, but this would work:
grep -q -E '^4\.7([^0-9]|$)'

It matches 4.7, 4.7., 4.7.0, ... 4.7a, 4.7-test
It does not match:
4.70, 4.71, etc

An alternative which requires '4.7' or '4.7.' is this:
grep -q -E '^4\.7(\.|$)'

It matches 4.7, 4.7., 4.7.0
It does not match:
4.70, 4.71, 4.7a, 4.7-test etc

It requires the extended regex feature set though, so I wonder whether
it's OK to use the extended syntax here?
Aug 21 2012