Simpified and stabilized getParentNodePattern by using StringHelper.splitBeforeLast()