check result of regexp are properly

It closes #43