Exclude unwanted lines from translation with regex filters
Debug strings, asset paths and leftover dev text can slip past auto-exclusion. RuneTranslate’s per-project regex filters exclude any line whose source matches a pattern — with a live preview of exactly what they catch — so you never spend a translation on junk. Free, on every tier.
Point RuneTranslate at a game and it pulls in every translatable string it can find. Most of that is real dialogue and menu text — but some of it is junk: leftover debug lines, asset filenames, internal flags and stray identifiers the game never shows a player. RuneTranslate already excludes the obvious cases per engine and marks them as red opt-in rows, but every game is different, and some junk is specific to the title you are working on.
That is what regex exclusion filters are for. You give RuneTranslate one or more patterns, and any line whose source text matches a pattern is dropped from the run — skipped by the translator and shown as a red opt-in row you can always switch back on. It is the same machinery as the built-in engine exclusions, but driven by your own rules and saved with the project. And it costs nothing: unlike the glossary and translation memory, regex exclusions are free on every tier.
Why exclude lines at all?
Two reasons — one obvious, one that matters more:
- Cost and time. Every junk line you translate is provider quota (or free-scraper rate limit) spent on text nobody will ever read. Across a whole game that adds up.
- Keeping the game working. This is the real one. Some lines are not text at all — they are keys, file paths or flow operands the engine resolves by value. Translate
bg_office_01orEV_FLAG_TRUEand you can silently break a scene transition or a variable lookup. Excluding them keeps the exported build stable.
Where to find it
Open a project, then in the editor toolbar open the ⋯ More menu and choose Regex exclusions. That opens the Custom exclusion filters panel — you add patterns, watch exactly what they catch, and apply, all in one dialog.
The live preview is the whole point
You never apply a pattern blind. As you type a regex, RuneTranslate shows Matches N of TOTAL lines and lists a handful of the real lines it would catch, updating on every keystroke. An invalid pattern is flagged instantly with the error, so you cannot save a broken one.
Because the preview shows your project’s actual lines, you tune the pattern until it catches exactly the junk and nothing real, then apply. One detail worth remembering: patterns match the source text — the original Japanese, or whatever your source language is — not the translation. You write patterns against the untranslated text.
Ready-made patterns
The panel ships with one-click preset chips for the patterns that come up on almost every Japanese game:
- ASCII only —
^[\x00-\x7F]+$— a line with no source-language characters at all (leftover English, romaji or an identifier). Usually safe to drop when your source is Japanese. - Asset path —
\.(png|jpe?g|gif|webp|ogg|mp3|wav|webm|mp4)$— anything ending in a media file extension. - Variable —
^[a-z_]+\.[a-z_]— dotted code references likef.pageorstate.flag. - ALL_CAPS token —
^[A-Z0-9_]+$— constants and flags such asEVENT_FLAG_3. - Numbers / symbols —
^[\d\s.,:%/+\-]+$— numeric-only rows and tile masks like11111112222. - Bracketed tag —
^\[.*\]$— a whole line that is nothing but a[tag].
The panel also shows a compact cheat-sheet for building your own: ^ and $ anchor the start and end of a line, . is any character, * and + mean zero-or-more and one-or-more, ? is optional, \d a digit, \w a word character and \s whitespace.
Writing your own filters
The presets cover the common cases; for anything game-specific you write your own JavaScript regular expression. A few rules of thumb:
- Anchor to the whole line. A bare
debugmatches any line containing that word — including real dialogue about debugging.^DEBUG:only matches lines that start with the marker, and wrapping a pattern in^...$matches the entire line. Anchoring is the safest default. - Watch the preview count. If a pattern jumps from catching 12 junk lines to catching 400, you have almost certainly caught real text — check the samples and tighten it.
- Prefer structure over words. Junk is usually recognizable by shape — all-caps, dotted paths, trailing file extensions, pure numbers — not by specific words. Structural patterns generalize across the whole project.
- One rule per idea. Several small, obvious patterns are easier to reason about, and to remove later, than one giant unreadable one.
Applying, and undoing
Hit Apply & save. RuneTranslate stores the patterns with the project and re-classifies every line, then tells you exactly what happened — for example Excluded 340 lines · 5 restored. The restored count is lines a filter used to catch but no longer does, brought back automatically.
It is fully reversible: delete a pattern, apply again, and its lines return. Filters only ever own their own exclusions — they never override an engine auto-exclusion — and you can still switch any single line back on with its row toggle if a filter was a touch too broad.
The reset-filtered-translations prompt
One case RuneTranslate handles for you: what if you filter out lines you had already translated? An excluded line exports its source text, but the old translation is still attached to it. So right after you apply, if any newly-filtered lines already carried a translation, RuneTranslate asks whether to reset them to pending — dropping the translation so export cleanly falls back to source — or keep them. Reset is usually what you want, since you excluded those lines precisely because you did not want them translated.
How it fits with everything else
Regex filters are the last-mile tool. The engine adapters already exclude the structural junk they know about for each format, so on a well-supported game the AI never sees an asset path. Filters are for the leftovers: a game-specific marker, one weird debug channel, or strings a niche engine surfaces that are not quite dialogue.
Use the editor’s Excluded status filter to review everything currently held back — engine exclusions and your regex exclusions together — and opt any of it back in. And where filters remove lines, the glossary does the opposite: it locks chosen terms so they always translate the same way. Between the two you control both what gets translated and how.
Five minutes with the Filters panel at the start of a project — drop in a couple of preset chips, glance at the preview, apply — saves quota on every run afterward and keeps risky non-text out of the translator entirely. Download RuneTranslate, open any game, and check the ⋯ More menu for Regex exclusions.
Ready to try RuneTranslate?
Free tier unlocks every engine + every translation provider. Supporter ($3/mo) unlocks full speed.
Download for Windows