Replace parsing with regexp