an simple regex parser