Given a path like a.b.c.d and a set of paths like {a.b.c, a.f.g, h.j}, this returns the original path split on dots such that the first element is in the set. For the above example it would return the array [a.b.c, d].
a.b.c.d
{a.b.c, a.f.g, h.j}
[a.b.c, d]