我有一根弦,像:
image.id."HashiCorp Terraform Team <terraform@hashicorp.com>"
AND image.label."some string"."some other string"
我想将所有空格替换为“\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
image.id."HashiCorp___Terraform___Team___<terraform@hashicorp.com>"
AND image.label."some___string"."some___other___string"
我试过这个:
text = text.replace(/"(\w+\s+)+/gi, function (a) {
return a.replace(' ', _delimiter);
});
但它只替换了第一个空格,所以我得到:
HashiCorp___Terraform Team <terraform@hashicorp.com>
.
和
some___other string