How do i exclude a text between <> when translating in google sheets

Viewed 68

I have an exported product list from Shopify. I need to translate the product description but in the exported description there are HTML codes that Have to stay intact. How do I exclude the code from my translation?

I use =googletranslate What can i add in my function to exclude all text between <> theese

2 Answers

You can strip tags with this function

function stripTags(body) {
  var regex = /(<([^>]+)>)/ig;
  return body.replace(regex,"");
}

use:

=REGEXREPLACE(A1; "</?\S+[^<>]*>"; )

or:

=REGEXREPLACE(A1; "<\/\w+>|<\w+.*?>"; )
Related