fixed some regexp bugs