Fix #9 - Replace expr with grep for matching

Tested on Debian, Archlinux and FreeBSD.