function parseXFAPath(path) {
  const positionPattern = /(.+)\[(\d+)\]$/;
  return path.split(".").map(component => {
    const m = component.match(positionPattern);
    if (m) {
      return { name: m[1], pos: parseInt(m[2], 10) };
    }
    return { name: component, pos: 0 };
  });
}
AcroForm field names use an array like notation to refer to
repeated XFA elements e.g. foo.bar[nnn].
see: XFA Spec Chapter 3 - Repeated Elements

@param {string} path - XFA path name.
@returns {Array} - Array of Objects with the name and pos of
each part of the path.