# Tagger Script: Loop through existing tags

**URL:** https://community.metabrainz.org/t/tagger-script-loop-through-existing-tags/569174
**Category:** MusicBrainz Picard
**Tags:** taggerscript, picard
**Created:** [January 23, 2022, 6:16am UTC](https://community.metabrainz.org/t/tagger-script-loop-through-existing-tags/569174 "2022-01-23T06:16:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![docky](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/d/f17d59/32.png) [@docky](https://community.metabrainz.org/u/docky)
#### Post date: [January 23, 2022, 6:16am UTC](https://community.metabrainz.org/t/tagger-script-loop-through-existing-tags/569174/1 "2022-01-23T06:16:42Z")

</div>

Hi,

In a tagger script how could I loop through available tags checking for it’s contents? When tags are not standard.  
The `$in()` function is what I want to create a series of checks and delete the ones that matches.

so the code would look something like:

```
$while(
  $lt(%_loop_count%
  ,$counttags()$noop(return the n# of tags in the file))
  ,$if($in(%current_tag%,Match),$delete(current_tag)))

```

Also is there a way to have case-insensitive `$in()`? _not important._

Thanks in advance.
