Fix Gnome Terminal version detection

(Discovered on OpenBSD.)

POSIX says that "Regular expression syntax shall be that defined in
XBD Basic Regular Expressions, [...]."

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/expr.html