Skip to main content

Tag Protect tool

The Tag Protect tool finds tags and placeholders in source text using regular-expression patterns and records them as an annotation on the block, along with a count property. Downstream tools (for example an MT or AI translation step) can then read the annotation to preserve those tokens rather than translating or reformatting them.

When no patterns are configured, a built-in default set is used, covering HTML/XML tags, curly-brace placeholders (ICU, Java, .NET), printf-style placeholders, and ${...} template expressions. The tool records what it found; preserving the matches is the job of the consuming tool.

IDtag-protect
SourceBuilt-in
CategoryText processing
Cardinalitymonolingual
Tagsregex, configurable

Parameters

ParameterTypeDefaultDescription
patternsstring[]Regex patterns for tags and placeholders to protect

Configure it live

Configuration
Loading form…

Examples

Protect the default token set

Use built-in patterns for tags and common placeholders.

patterns: []

Protect only HTML tags

Restrict protection to markup tags.

patterns:
- "<[^>]+>"

Processing notes

  • Operates on translatable blocks only; non-translatable blocks pass through unchanged.

  • Matches are recorded as a block annotation and the match count as a block property; matches are deduplicated and ordered by offset.

Limitations

  • Patterns use Go's RE2 syntax, which does not support backreferences or lookaround.

  • The tool records protected matches as an annotation; it does not itself prevent their modification.

← Back to the Tool Reference