
An invalid custom regular expression in Affinity preflight fails silently and matches nothing. A missing warning therefore does not prove your text is clean. Check the pattern's validity, enabled state, severity and active profile with a known harmless example before relying on it.
Key Takeaways
- Invalid patterns can fail without an error message.
- A disabled pattern cannot inspect the document.
- Keep replacement off while diagnosing a match.
Establish the check is running
The Affinity preflight documentation describes custom Text Patterns and the silent-failure behavior. Open the active profile's Text Patterns settings and confirm the pattern's checkbox is enabled and its warning level is not disabled.
Run Check Now when needed. A pattern saved in a different profile cannot establish the result for the profile currently active. The preflight scope guide explains the broader risk of interpreting a clean result without checking coverage.
Start with an unmistakable marker
In a separate diagnostic copy, insert a harmless marker such as TEMP_PHOTO_APPROVAL in ordinary document text. Use that literal marker as the simplest initial pattern. Confirm that preflight reports it before adding more complex syntax.
This is a proposed positive-control method, not a tested Affinity result. It isolates whether the configured check can find known text. If the simple case works but your complex expression does not, inspect its syntax and assumptions instead of disabling the warning.
A simple punctuation error in an expression can change its meaning or make it invalid. Do not paste an unfamiliar pattern into production and trust silence.
Avoid destructive replacement experiments
Leave Replace off during diagnosis. The official help warns that an enabled replacement with an empty replacement field deletes matching text when the fix is applied. Preserve the document before testing any replacement operation.
If a rule targets names in a personalized book, review every intended substitution. The editable-name guide explains why names deserve a controlled text workflow. An overbroad pattern can affect valid content as well as placeholders.
Verify the production rule
Once the diagnostic match is understood, test the intended expression against one known match and one similar nonmatch in the separate copy. Save the custom profile if it must remain available across profile changes. Remove test markers before producing the final artifact.
Generated content may later overwrite manual changes, so keep the rule and production responsibility documented; the TOC update guide illustrates that separate risk. For EPUB, Affinity's fixed-layout guidance adds structural checks that a text regex cannot replace.
Acceptance means known matches are reported, valid nonmatches are left alone and the intended profile is recorded. This guide proposes a diagnostic workflow without claiming that a particular expression has been executed or certified safe.
Retain the tested pattern with its intended purpose.
Related tasks
- Why Does InDesign Preflight Show No Errors When My File Still Has Problems?
- Why Does Updating My InDesign Table of Contents Undo My Manual Corrections?
- How Do I Add a Child’s Name to an AI Picture Book Without Garbled Text or Broken Pages?
Sources and scope
- Preflight: Invalid regex can silently fail; test on a known positive sample.
Guidance follows current Affinity desktop documentation. Worked examples and checks are proposed, not measured software tests.
Prepared by Imagild Editorial, the company editorial team responsible for these guides. AI assisted research and drafting. This is documentation-based guidance with proposed examples, not a claim of hands-on testing or an independent product review. Report a correction.
Cover: AI-generated conceptual editorial illustration; not a real application screenshot, observed output or before-and-after test.