implemented regex parser