# Regex for "\[Live\]"

**URL:** https://community.mp3tag.de/t/regex-for-live/11815
**Category:** Support
**Created:** [April 5, 2011, 9:09am UTC](https://community.mp3tag.de/t/regex-for-live/11815 "2011-04-05T09:09:09Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MatthiasM](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@MatthiasM](https://community.mp3tag.de/u/MatthiasM)
#### Post date: [April 5, 2011, 9:09am UTC](https://community.mp3tag.de/t/regex-for-live/11815/1 "2011-04-05T09:09:09Z")

</div>

Hi everybody,

I want to tag live albums in a special manner.  
All titles of a live album should get a postfix "[Live]" and also the album tag itself.  
But if an album or title already contains a "[Live]" at the end it should keep it as is.  
This should also include variations like "[Live At Budokan]"

Any idea how I can do this with an action?

I know that an easy regex-match would be

```
\s*(\[Live.*\])\s*$

```

But how can I negate it (matching only lines which doesn't contain this?  
And / Or combine it with a replacement?

Could somebody please push me to the right direction?  
As we say in German: "Ich stehe auf dem Schlauch" 😉

best regards in advance,  
Matthias

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [April 5, 2011, 9:37am UTC](https://community.mp3tag.de/t/regex-for-live/11815/2 "2011-04-05T09:37:03Z")

</div>

> [@MatthiasM](#):
>
> I know that an easy regex-match would be
> 
> ```
> \s*(\[Live.*\])\s*$
> 
> ```
> 
> But how can I negate it (matching only lines which doesn't contain this?  
> And / Or combine it with a replacement?

Action: Format Value  
Field: TITLE  
Formatstring: $if($eql($regexp(%title%,'._\s[Live._]\s\*',XXXXX),XXXXX),%title%,%title% '[Live]')

and the same for album

The regex could be expanded to match also live and LIVE and round parenthesis.

---

<div class="post-metadata">

### Author: ![MatthiasM](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@MatthiasM](https://community.mp3tag.de/u/MatthiasM)
#### Post date: [April 5, 2011, 11:47am UTC](https://community.mp3tag.de/t/regex-for-live/11815/3 "2011-04-05T11:47:10Z")

</div>

Thanks a lot!

That trick with replacing the string only for comparison points me to the right direction ![:w00t:](https://community.mp3tag.de/uploads/default/original/1X/cb01eca72fe9339ff6f3ec9f1e3c5fe002be0f0a.gif ":w00t:")

This is what I'm using now (for the title):

```
$if($eql($regexp(%title%,'[(\[]Live[^)\]]*[)\]]\s*$',XXXXX,1),%title%),%title% '[Live]',$regexp(%title%,'[(\[]Live([^)\]]*)[)\]]\s*$','[Live$1]',1))

```

It ignores case (fourth parameter to regexp), also finds "(Live)" and either adds a "[Live]" to the end or replaces the existing one to be always surrounded by a "[", "]" pair.  
Example:

```
"Hello My Friend" -> "Hello My Friend [Live]"
"Hello My Friend [Live]" -> "Hello My Friend [Live]"
"Hello My Friend (Live, US) " -> "Hello My Friend [Live, US]"
"Hello My Friend (Live, US]" -> "Hello My Friend [Live, US]"

```

The latter is an accident because I'm unable to match only character "pairs" (so that a leading "(" only matches to a closing ")" and not to "]")

But that's O.K.

You made my day!

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [April 5, 2011, 1:06pm UTC](https://community.mp3tag.de/t/regex-for-live/11815/4 "2011-04-05T13:06:41Z")

</div>

> [@MatthiasM](#):
>
> This is what I'm using now (for the title):
> 
> ```
> $if($eql($regexp(%title%,'[(\[]Live[^)\]]*[)\]]\s* ,XXXXX,1),%title%),%title% '[Live]',$regexp(%title%,'[(\[]Live([^)\]]*)[)\]]\s* ,'[Live$1]',1))
> 
> ```

good one!

---

<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 9, 2026, 12:23pm UTC](https://community.mp3tag.de/t/regex-for-live/11815/5 "2026-02-09T12:23:01Z")

</div>


