check regex match before use

Check that *vv* is not null before accessing indexes.