# Using "\[\]" as brackets in a regular expression

**URL:** <https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213>\
**Category:** Support\
**Created:** [August 10, 2017, 12:29am UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213 "2017-08-10T00:29:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron\_Mark](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@Ron\_Mark](https://community.mp3tag.de/u/Ron_Mark)\
**Post date:** [August 10, 2017, 12:29am UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/1 "2017-08-10T00:29:59Z")

</div>

Am trying to re-organize my music folder and would like to header each letter (eg. [A] Artists, [B] Artists, etc). I have been able to use $validate($replace(F:\F PreInbox$left('[%albumartist%,1]')\%albumartist%\%album% $num(%year%,4), , ), %mediatype%,'\_') which gives me the structure I want minus the "[]" .. I have been playing around with the positioning of the '[and the]' but have yet to get it correct....any assistance would be appreciated.

---

<div class="post-metadata">

**Author:** ![Ron\_Mark](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@Ron\_Mark](https://community.mp3tag.de/u/Ron_Mark)\
**Post date:** [August 10, 2017, 1:11am UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/2 "2017-08-10T01:11:32Z")

</div>

Ok my error, this isn't in a regular expression however the question still remains. Would also like to try to figure out if I can set up after processing via some if not all of BPM processing, KeyFinder and Album Art Downloader where I can move the folder(s) that I just processed (if in already in the order I wanted) directly to my Media/Music Folder bypassing the Pre Inbox folder?

---

<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:** [August 10, 2017, 3:19am UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/3 "2017-08-10T03:19:45Z")

</div>

The square brackets serve as some kind of "if" statement: if there is nothing in the named field variable don't ouput the text in brackets - a text option.  
If you want to get the brackets as literals, you have to use '[' and ']' like '['%year%']'.

---

<div class="post-metadata">

**Author:** ![Ron\_Mark](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@Ron\_Mark](https://community.mp3tag.de/u/Ron_Mark)\
**Post date:** [August 10, 2017, 10:04am UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/4 "2017-08-10T10:04:19Z")

</div>

Thank you for the response from looking at your example, I was missing the extra ' . I only had '[%year]' ....

---

<div class="post-metadata">

**Author:** ![Ron\_Mark](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/c37758/32.png) [@Ron\_Mark](https://community.mp3tag.de/u/Ron_Mark)\
**Post date:** [August 12, 2017, 1:54pm UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/5 "2017-08-12T13:54:23Z")

</div>

> [@MyAlteredEgo](#):
>
> Thank you for the response from looking at your example, I was missing the extra ' . I only had '[%year]' ....

Ok so I am still having positioning issues even though I have followed the above

$validate($replace(F:\F PreInbox$left('['%albumartist%,1']')\%albumartist%\%album% $num(%year%,4), , ), %mediatype%,'\_')

Is not working the way that I am trying to get it to do....just where should these brackets be placed for my desired results as I have moved them around and still have not been able to get it to work properly..the assistance is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [August 12, 2017, 2:27pm UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/6 "2017-08-12T14:27:53Z")

</div>

What about:  
'['$left(%albumartist%,1)']'

---

<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:** [August 12, 2017, 3:08pm UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/7 "2017-08-12T15:08:46Z")

</div>

You can test your expression with the function Convert\>Teg-Tag.

$left('['%albumartist%,1)']'

would always return the [ as this is the first character from the left.

---

<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:26pm UTC](https://community.mp3tag.de/t/using-as-brackets-in-a-regular-expression/19213/8 "2026-02-09T12:26:56Z")

</div>


