I believe your goal as follows.
You want to retrieve https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.pdf from the following string using Google Apps Script.
const str = `link|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755|
link_of_pdf|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.pdf|
link_of_xml|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.xml|`;
For this, how about this answer?
Pattern 1:
In this pattern, split is used. In this case, when the position of the URL you want is the same, this can be used.
Sample script:
const str = `link|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755|
link_of_pdf|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.pdf|
link_of_xml|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.xml|`;
const res = str.split("|")[3];
console.log(res)
Pattern 2:
In this pattern, regex is used. In this case, when the URL you want is enclosed by link_of_pdf| and |, this can be used.
Sample script:
const str = `link|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755|
link_of_pdf|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.pdf|
link_of_xml|https://www.nubefact.com/cpe/3a5c76ea-9447-4f34-9b90-7f514345cbf8-474b0936-c936-49f5-acb6-9e94102ce755.xml|`;
const res = str.match(/link_of_pdf\|(.+)\|/)[1];
console.log(res)
References: