Filtering and Searching Files and Tags

The Filter field in Mp3tag's toolbar allows for searching files that meet a certain criteria (e.g., the filename contains specific characters or a tag field has a specific content). To filter the file list simply start typing in the filter field. As a result, all files that contain the specified filter string in their tag or filename are listed in the file list.

Sometimes it is necessary to use more complex criteria to search for files (e.g., all files of a specific genre but not of that artist). To achieve this, Mp3tag supports filter expressions. Filter expressions are simple expressions that consist of tag field names, filter keywords and text.

Notes

  • If <field> or <string> contains spaces, it should be enclosed in double quotation marks, e.g., artist IS "Hidden Orchestra".

  • If <field> in HAS/IS/GREATER/LESS/EQUAL/MATCHES contains $ or % it should be enclosed in double quotation marks and will be treated as a format string instead of a tag field name. This will decrease search speed on large libraries since the format strings need to be evaluated before filtering.

  • It is not possible to filter by strings containing double quotations marks. This is a limitation of the feature.

  • All operations are non-case sensitive. All filter keywords must be uppercase.

Filter Syntax

<string>

Returns only files that contain every word in the string as a word or substring thereof. A word is a contiguous sequence of characters excluding the space character.

Example: Hidden Orchestra
This filter string lists all files that contain the words Hidden and Orchestra in tags or filenames.

<field> HAS <string>

Returns only files that have all words from <string> in their tag field named <field>. You can use * to address all fields.

Example: artist HAS Orchestra
Lists all files where the artist field contains Orchestra (e.g., Hidden Orchestra and The Cinematic Orchestra).

<field> IS <string>

Returns only files where the content of at least one tag field named <field> is equal to <string>.

Example: artist IS "Hidden Orchestra"
Lists all files where the artist field is Hidden Orchestra.

<expr1> AND <expr2>

<expr1> OR <expr2>

Combines the filter expressions <expr1> and <expr2> by logical and or or. Parentheses can be used to group combined expressions.

Example: artist IS Hidden Orchestra OR artist IS The Cinematic Orchestra
Lists all files where an artist field is either Hidden Orchestra or The Cinematic Orchestra.

NOT <expr>

Inverts the result of <expr>.

Example: NOT artist IS "Hidden Orchestra"
Lists all files where the artist field is not Hidden Orchestra.

<field> GREATER <number>

<field> LESS <number>

<field> EQUAL <number>

Returns all files where the content of tag field named <field> is greater, equal, or less that the integer value specified by <number>.

Example: "%_bitrate%" GREATER 180
Lists all files with a bitrate above 180. Please note that <field> is a format string in that example.

<field> MISSING

Returns all files which don't have a tag field named <field>. Actually, you can also use ABSENT here.

Example: albumartist MISSING
Lists all files that don't have the albumartist field.

<field> PRESENT

Returns all files which have a tag field named <field>.

Example: albumartist PRESENT
Lists all files that have the albumartist field.

<field> MATCHES <regexp>

Returns only files where the content of the tag field named <field> matches against the regular expression <regexp>. You can use * to address all fields.

Example: track MATCHES \d\/\d
Lists all files where the tracknumber is in #/# format.

Further Reading

1 Like