TXT parser and text rules
Choose or create TXT parsers, and clean up text with replacement, deletion and highlight rules.
TXT files contain no chapter structure, so a parser splits them. Text rules handle ads, watermarks and broken line breaks.
TXT parser
Switch parsers
- Open reading options → More.
- Find TXT parser.
- Choose a built-in or custom parser; it applies immediately.
Built-in parsers
| Parser | Use case |
|---|---|
| Default parser | Most TXT files |
| Chinese novel parser | 第一章, 第2回 and similar |
| English novel parser | Chapter 1, Part II and similar |
| Number parser | Numeric titles such as 1, 2, 3 |
Custom parsers
- Open Settings > TXT parser.
- Fill in Parser name and Parser regex.
- Click Add.
- The parser appears in the reading options dropdown.
Examples:
| Case | Regex |
|---|---|
| Chinese chapters | ^(第[一二三四五六七八九十百千0-9]+[章回节卷].*)$ |
| English chapters | `^(Chapter |
| Numeric headings | ^\d+(\.\d+)*\s+.*$ |
Names cannot be empty or duplicated; invalid regex reports “Invalid regex pattern”. Custom parsers can be edited or deleted.
Text rules
On desktop, open Settings > Text rules; on mobile, open Settings > Reading options > Text rules management. There are three kinds:
| Type | Effect |
|---|---|
| Replacement rules | Replace matched text |
| Deletion rules | Remove matched text |
| Highlight rules | Apply a highlight style to matched text |
Rule fields
| Field | Description |
|---|---|
| Match type | Plain text or Regular expression |
| Match pattern | Text or regular expression |
| Replacement | Replacement rules only; empty means delete |
| Highlight style | Highlight rules only, including colour |
| Scope | All books, or one specific book |
Rules can be edited and deleted. Saving validates the pattern, replacement and regex; choosing a specific book without selecting one reports “Please select a book”.
Examples
| Goal | Pattern | Replacement |
|---|---|---|
| Remove URLs | https?://\S+ | empty |
| Drop ad lines | ^本章未完.*$ | empty |
| Normalise quotes | [“”] | " |
| Space chapter numbers | 第(\d+)章 | 第 $1 章 |
Notes
- Rules affect display and copied text, never the original file.
- Book-specific rules win over global rules.
- Highlight rules do not create exportable annotations.
FAQ
TXT has no chapters. Try another parser, or check for invisible characters in title lines.
Chapters are merged. The regex is too strict; use a looser pattern.
A rule does nothing. Check the scope and the match type.
A rule removed too much. Disable or delete the rule.