# A, An and The exclusion

**URL:** https://community.mp3tag.de/t/a-an-and-the-exclusion/67296
**Category:** Support
**Created:** [January 27, 2025, 10:54pm UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296 "2025-01-27T22:54:06Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Gat3pm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@Gat3pm](https://community.mp3tag.de/u/Gat3pm)
#### Post date: [January 27, 2025, 10:54pm UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/1 "2025-01-27T22:54:06Z")

</div>

Have this to remove a, an or the but want to keep them if not the first word of the string,

 ![image](https://community.mp3tag.de/uploads/default/original/3X/d/5/d59e0ebea3fa0a9849dc940ede4dc3111cb160a8.png)

Like in "2 The Hard Way" I would want to keep "The" in place in this instance

or

Like in "Maybe A Dingo Ate Your Baby" I would want to keep "A" in place in this instance

What would I add to this expression to keep a, an or the when not the first word?

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [January 28, 2025, 2:21am UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/2 "2025-01-28T02:21:09Z")

</div>

This was just recently answered for you here.

> [@Remove a, an and the](https://community.mp3tag.de/t/remove-a-an-and-the/67274/2):
>
> Create an action of the type "Replace with regular expression" for the field with the string (you don't say which it would be) Search string: ^A |The |An Replace with: (leave empty) For more details about regular expressions, see the documentation: I, for myself have abandoned the idea to remove the articles. Otherwise artist names like The The The Band The Duke & the King The Weeknd A Fine Frenzy A Flock of Seagulls A Guy called Gerald A Mountain of One A Tribe called Quest wo…

---

<div class="post-metadata">

### Author: ![Gat3pm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@Gat3pm](https://community.mp3tag.de/u/Gat3pm)
#### Post date: [January 28, 2025, 2:34am UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/3 "2025-01-28T02:34:22Z")

</div>

I only want to take out A, An or The if they are the FIRST word of the string, Other wise I want to keep them in.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 28, 2025, 5:42am UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/4 "2025-01-28T05:42:35Z")

</div>

> [@Gat3pm](#):
>
> to keep a, an or the when not the first word

Try  
`$regexp(%title%,^(A |An |The ),)`

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [January 28, 2025, 7:28am UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/5 "2025-01-28T07:28:27Z")

</div>

> [@Gat3pm](#):
>
> Like in "Maybe A Dingo Ate Your Baby" I would want to keep "A" in place in this instance

Your regular expression has only two small errors:  
`$regexp(%title%,^A |An |The |,)`  
should be - as @ohrenkino says:  
`$regexp(%title%,^(A |An |The ),)`  
which means:

 ![image](https://community.mp3tag.de/uploads/default/original/3X/4/e/4eeea7d88a0cd2b0e025e4907f911e86ad5a35d0.png)

The pipe symbol | gives you a selection:  
A or An or The (all three followed by a space)  
The pipe symbol should not be the last character.  
The brackets around this selection represent the caption group, which will be replaced if one of the 3 possibilities starts `^` as the first character(s) of the line.  
The matched possibility will be replaced with nothing (nothing is given after the comma).

---

<div class="post-metadata">

### Author: ![Gat3pm](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/df705f/32.png) [@Gat3pm](https://community.mp3tag.de/u/Gat3pm)
#### Post date: [January 28, 2025, 6:23pm UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/6 "2025-01-28T18:23:57Z")

</div>

Thank You for explaining It. Trying to learn off other peoples posts is hard a lot of the time. The end results of what it should look like are not provided. I am one of those people that has to see it to understand it, especially if I am unfamiliar with the context of what is happening.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [January 28, 2025, 6:25pm UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/7 "2025-01-28T18:25:43Z")

</div>

You can test scripting functions including $regexp() in Convert\>Tag-Tag.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 27, 2025, 6:26pm UTC](https://community.mp3tag.de/t/a-an-and-the-exclusion/67296/8 "2025-02-27T18:26:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
