check regex match before use
Merge pull request #6 from aleno/patch-1

check regex match before use