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

Time:12-11

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 I don't want to disturb. How do I exclude the code from my translation?

CodePudding user response:

You can strip tags with this function

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

CodePudding user response:

use:

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

or:

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