# Error while parsing RegEx

**URL:** <https://community.mp3tag.de/t/error-while-parsing-regex/58108>\
**Category:** Support\
**Created:** [August 5, 2022, 5:10am UTC](https://community.mp3tag.de/t/error-while-parsing-regex/58108 "2022-08-05T05:10:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [August 5, 2022, 5:10am UTC](https://community.mp3tag.de/t/error-while-parsing-regex/58108/1 "2022-08-05T05:10:25Z")

</div>

Hi,

I'm attempting to use the RegEx  
`$regexp(%albumsort%,\s(Vol. (?=(\s*\.*\s*[0-9])+)(\s*\.*\s*([0-9]+)\s*))$,)`

And the following error is being produced.

> Invalid preceding regular expression prior to repetition operator. The error occurred while parsing the regular expression fragment: '`s*\.*\s*(+>>>HERE>>>)\s*))$`'.

Mp3Tag 3.17 x64

---

<div class="post-metadata">

**Author:** ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)\
**Post date:** [August 5, 2022, 6:06am UTC](https://community.mp3tag.de/t/error-while-parsing-regex/58108/2 "2022-08-05T06:06:22Z")

</div>

You're using the special characters [and] without escaping them or without enclosing the whole expressing in '

Try  
`$regexp(%albumsort%,'\s(Vol. (?=(\s*\.*\s*[0-9])+)(\s*\.*\s*([0-9]+)\s*))$',)`

From the [documentation](https://docs.mp3tag.de/scripting/#string-functions):

> Please note that you have to escape comma and other special characters in e.

---

<div class="post-metadata">

**Author:** ![djdizzle](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@djdizzle](https://community.mp3tag.de/u/djdizzle)\
**Post date:** [August 5, 2022, 6:08am UTC](https://community.mp3tag.de/t/error-while-parsing-regex/58108/3 "2022-08-05T06:08:50Z")

</div>

I didn't think the sqare brackets were supposed to be escaped, as they're encapsulating a range.

That's better. The only thing now... the letter immediately following a `(` is now lower case.  
Although, it doesn't really matter as the `ALBUMSORT` tag shouldn't have any extended properties in it, eg. `[Extended Title]`, `(Extended Title)` or `{Extended Title}`

---

<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:** [September 4, 2022, 6:09am UTC](https://community.mp3tag.de/t/error-while-parsing-regex/58108/4 "2022-09-04T06:09:39Z")

</div>

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