use regexp for syntax validation in completion