# Tag Rules

*Tag Rules* allow you to write rules that will extend the basic functionality of automatic tagging. The rules will be applied to the list of tags returned by the plugins in order to filter or rewrite the tags based on your tastes.

*Tag Rules* must be written one rule per line, without "*comma*" or "*semicolon*" unless they are part of the tag.

The format is as follows:

* `tag | -tag` : removes the tag
* `-namespace:*` : removes all tags within this namespace
* `~namespace` : strips the namespace from the tags
* `tag -> new-tag` : replaces one tag
* `tag => new-tag` : replaces one tag, but uses a hash table internally for faster performance. These rules will be executed **once** after all other rules.
* `namespace:* -> new-namespace:*` : replaces the namespace in all tags that contain it

Also note that *the match is case insensitive*, but the replacement will keep the case specified in the rule, so you can write this rule

```
serie:one piece -> parody:One Piece
```

to replace `SERIE:ONE PIECE` with `parody:One Piece`.

## Blacklist

This is the simplest list of rules you can write. Both formats are valid:

```
already uploaded
forbidden content
incomplete
ongoing
complete
various
digital
translated
```

```
-already uploaded
-forbidden content
-incomplete
-ongoing
-complete
-various
-digital
-translated
```

## Advanced usage

Combining the above rules, you can make *LRR* do some work for you. For example the following set of rules:

```
-already uploaded
-misc:*
serie:* -> parody:*
various -> various artists
~language
```

will transform this tag list

```
already uploaded, misc:ongoing, misc:complete, language:english,
serie:one piece, serie:naruto, various, crossover'
```

in this

```
english, parody:one piece, parody:naruto, various artists, crossover
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sugoi.gitbook.io/lanraragi/advanced-usage/tag-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
