making the compile-mode regexp more accurate