This issue is addressed in 14.1 CP6 or later via the following fixes.
In CP3
https://docops.ca.com/ca-identity-manager/14-1/EN/release-information/release-notes-14-1-cumulative-patches/cp-im-140100-0003-fixed-defects-list 874865 - DE331667 - Unable to export an environment when a rule string is used in eTADSMemberOf attribute, and throws "String index out of range -1" error. eTADSMemberOf attribute expects a groupDN, which definitely contains ",DC=" as a substring. However, if a rule string is used instead of groupDN, it may not have ",DC=" as a substring.
In CP6
https://docops.ca.com/ca-identity-manager/14-1/EN/release-information/release-notes-14-1-cumulative-patches/cp-im-140100-0006-fixed-defects-list 1068902 - DE363361 - Unable to export an environment when a rule string is used in eTADSMemberOf attribute, and throws "String index out of range -1" error. eTADSMemberOf attribute expects a groupDN, which definitely contains ",DC=" as a substring. However, if a rule string is used instead of groupDN, it may not have ",DC=" as a substring.