# SayRegexp Problem

**URL:** <https://community.mp3tag.de/t/sayregexp-problem/19109>\
**Category:** Web Sources Discussion\
**Created:** [July 1, 2017, 11:36am UTC](https://community.mp3tag.de/t/sayregexp-problem/19109 "2017-07-01T11:36:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [July 1, 2017, 11:36am UTC](https://community.mp3tag.de/t/sayregexp-problem/19109/1 "2017-07-01T11:36:41Z")

</div>

Using this regexp: (for websource parsing)

```
sayregexp "(?<=\"artists\" data-aid=\"(\d+)\">)[^<]+ ", " "trk-list-cont"

```

Code for testing (using ![:mt_ttt:](https://community.mp3tag.de/uploads/default/original/1X/f8c08645074b054ac98070f71500627b98311bd2.png ":mt\_ttt:"))

```
(?<=\"artists\" data-aid=\"(\d+)\">)[^<]+

```

I'm trying to seperate the artists from the following code example.

```
<a href="/artist/artist 1" class="artists" data-aid="392805">Artist 1</a><a href="/artist/artist 2" class="artists" data-aid="3805">Artist 2</a>trk-list-cont

```

To result in:

```
Artist 1, Artist 2

```

As you can see the digits are the non fixed width. Only it returns an Invalid lookbehind error. Which is down to the regexp language used by Mp3tag (I think), so.. .

1. Any workaround for this?
2. What regexp language does Mp3tag use as .NET regexp can take advantage of non fixed widths inside lookarounds.

---

<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:** [July 1, 2017, 4:13pm UTC](https://community.mp3tag.de/t/sayregexp-problem/19109/2 "2017-07-01T16:13:46Z")

</div>

1. Maybe KillTag can be of help here?

2. Mp3tag uses boost::regex which doesn't support non-fixed widths inside lookbehind.

Kind regards  
– Florian

---

<div class="post-metadata">

**Author:** ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)\
**Post date:** [July 2, 2017, 7:35am UTC](https://community.mp3tag.de/t/sayregexp-problem/19109/3 "2017-07-02T07:35:27Z")

</div>

Or maybe do a regexpreplace for the data-aid value to make them all uniform if you don't need those identifiers anymore. Could be numbers or letters, whatever you choose. Here, I'm going to swap those digits with a string of zeroes:

regexpreplace "(class="artists" data-aid=")\d+" "${1}00000"

```
<a href="/artist/artist 1" class="artists" data-aid="392805">Artist 1</a><a href="/artist/artist 2" class="artists" data-aid="3805">Artist 2</a>trk-list-cont

```

to

```
<a href="/artist/artist 1" class="artists" data-aid="00000">Artist 1</a><a href="/artist/artist 2" class="artists" data-aid="00000">Artist 2</a>trk-list-cont

```

Now, you have don't have non-fixed lengths to worry about.

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [July 2, 2017, 8:27am UTC](https://community.mp3tag.de/t/sayregexp-problem/19109/4 "2017-07-02T08:27:29Z")

</div>

QUOTE (Florian @ Jul 1 2017, 19:13) \<{POST\_SNAPBACK}\>

1. Maybe KillTag can be of help here?

```
killtag "a"
killtag "/a" ", "

```

1. Mp3tag uses boost::regex which doesn't support non-fixed widths inside lookbehind.

Kind regards  
– Florian

  
Thanks. I've never actually had to use killtag before. I'll try see if I can make use of it. I've used the solution as below.

I suppose there's no furture plans to migrate to .NET regex?

> [@ms6676749](#):
>
> Or maybe do a regexpreplace for the data-aid value to make them all uniform if you don't need those identifiers anymore. Could be numbers or letters, whatever you choose. Here, I'm going to swap those digits with a string of zeroes:
> 
> regexpreplace "(class="artists" data-aid=")\d+" "${1}00000"
> 
> ```
> <a href="/artist/artist 1" class="artists" data-aid="392805">Artist 1</a><a href="/artist/artist 2" class="artists" data-aid="3805">Artist 2</a>trk-list-cont
> 
> ```
> 
> to
> 
> ```
> <a href="/artist/artist 1" class="artists" data-aid="00000">Artist 1</a><a href="/artist/artist 2" class="artists" data-aid="00000">Artist 2</a>trk-list-cont
> 
> ```
> 
> Now, you have don't have non-fixed lengths to worry about.

Thanks. Yeah, that's exactly what I've been doing for years. Just wanted to see if there was a headon solution.

**My solution: (is to enable fixed length lookbehind)**  
regexpreplace "("artists" data-aid=")\d+" "$1albumartist\_fix"

---

<div class="post-metadata">

**Author:** ![ms6676749](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/b4bc9f/32.png) [@ms6676749](https://community.mp3tag.de/u/ms6676749)\
**Post date:** [July 4, 2017, 4:53pm UTC](https://community.mp3tag.de/t/sayregexp-problem/19109/5 "2017-07-04T16:53:38Z")

</div>

> [@stevehero](#):
>
> Thanks. Yeah, that's exactly what I've been doing for years. Just wanted to see if there was a headon solution.
> 
> **My solution: (is to enable fixed length lookbehind)**
> 
> ```
> regexpreplace "(\"artists\" data-aid=\")\d+" "$1albumartist_fix"
> 
> ```

Yeah, yours makes the most sense when targeting %albumartist%.
