# Add explanations in regexp

**URL:** https://community.mp3tag.de/t/add-explanations-in-regexp/14044
**Category:** Support
**Created:** [October 26, 2012, 10:12pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044 "2012-10-26T22:12:42Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![ykeyke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ykeyke](https://community.mp3tag.de/u/ykeyke)
#### Post date: [October 26, 2012, 10:12pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/1 "2012-10-26T22:12:42Z")

</div>

Hi people,

I'm wandering about if there is anyway to add comments and explanation into actions and actions groups, to explain what the expression do (each line), this way it becomes easy to understand in posterior views. As I'm beginning with the regexp, this would help a lot...

Thanks

---

<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: [October 26, 2012, 10:45pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/2 "2012-10-26T22:45:44Z")

</div>

> [@ykeyke](#):
>
> Hi people,
> 
> I'm wandering about if there is anyway to add comments and explanation into actions and actions groups

Yes, use **(?#****) **to sit beside the regexp with the comment between the** # **and** )**. See attached it working for ![:mt_ttt:](https://community.mp3tag.de/uploads/default/original/1X/f8c08645074b054ac98070f71500627b98311bd2.png ":mt\_ttt:") and the same can be said for using it in the replace with regular expressions action.

 

**Example:**

$regexp(%title%,'**(?#**findspaces**)**\s+',) **Screenshots** :

 ![](https://community.mp3tag.de/uploads/default/original/2X/9/9c4d121ad2e5601259f04a854afe69397e1af569.jpg)  
  
  ![](https://community.mp3tag.de/uploads/default/original/2X/0/0de804172e5d19c202f0b2ed44873d581dcfad37.jpg)  

 

 ![](https://community.mp3tag.de/uploads/default/original/2X/9/9c4d121ad2e5601259f04a854afe69397e1af569.jpg)  

 ![](https://community.mp3tag.de/uploads/default/original/2X/0/0de804172e5d19c202f0b2ed44873d581dcfad37.jpg)

---

<div class="post-metadata">

### Author: ![ykeyke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ykeyke](https://community.mp3tag.de/u/ykeyke)
#### Post date: [October 26, 2012, 10:55pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/3 "2012-10-26T22:55:10Z")

</div>

Is it important, in which position this sequence is put? Or the position has no effect on the functionality of the regexp ?

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [October 26, 2012, 11:03pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/4 "2012-10-26T23:03:08Z")

</div>

I'd love to be able to add comments to action groups. I'd never consider adding one within a regex, as it would only add confusion.

---

<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: [October 26, 2012, 11:08pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/5 "2012-10-26T23:08:45Z")

</div>

> [@ykeyke](#):
>
> Is it important, in which position this sequence is put? Or the position has no effect on the functionality of the regexp ?

As long as it doesn't break the functionality of the regexp it's fine. It makes sence to put the comment before the regexp. So an example for matching dates in the format YYYY-MM-DD your regexp would look something like this.

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **YEAR** _Formatstring:_ **$regexp(%date%,'(?#DATE Format YYYY-MM-DD to YEAR in YYYY)(\d{4})-\d{2}-\d{2}','$1')**

End Action Group **\_Script Test#TEST** (1 Action)

**Before:**  
DATE: 1999-10-12

**After:**  
DATE: 1999-10-12  
YEAR: 1999

---

<div class="post-metadata">

### Author: ![ykeyke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ykeyke](https://community.mp3tag.de/u/ykeyke)
#### Post date: [October 26, 2012, 11:12pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/6 "2012-10-26T23:12:10Z")

</div>

Perfect. Thank you stevehero... 😉

---

<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: [October 26, 2012, 11:14pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/7 "2012-10-26T23:14:04Z")

</div>

> [@JJ Johnson](#):
>
> I'd love to be able to add comments to action groups. I'd never consider adding one within a regex, as it would only add confusion.

+1 by giving each action within a group a title or description would be great.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 27, 2012, 7:46am UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/8 "2012-10-27T07:46:31Z")

</div>

> [@JJ Johnson](#):
>
> I'd love to be able to add comments to action groups. ...

As a workaround ... it should be possible to insert a dummy action at any step into a sequence of actions.

Action: Format value  
Field: DUMMY  
Format string: 'This is my comment to the following action ...'

DD.20121027.1144.CEST

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [October 27, 2012, 7:48am UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/9 "2012-10-27T07:48:43Z")

</div>

> [@ykeyke](#):
>
> Is it important, in which position this sequence is put? Or the position has no effect on the functionality of the regexp ?

You can insert one or more comments into a regular expression ...  
~~[http://www.regular-expressions.info/comments.html](http://www.regular-expressions.info/comments.html)~~  
DD.20121027.1146.CEST

[http://www.regular-expressions.info/freesp...l#parenscomment](http://www.regular-expressions.info/freespacing.html#parenscomment)

DD.20140918.2000.CEST

---

<div class="post-metadata">

### Author: ![ykeyke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/y/d26b3c/32.png) [@ykeyke](https://community.mp3tag.de/u/ykeyke)
#### Post date: [October 28, 2012, 4:42pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/10 "2012-10-28T16:42:07Z")

</div>

> [@DetlevD](#):
>
> As a workaround ... it should be possible to insert a dummy action at any step into a sequence of actions.
> 
> Action: Format value  
> Field: DUMMY  
> Format string: 'This is my comment to the following action ...'
> 
> DD.20121027.1144.CEST

Mr. DUMMY, is a very important person, fits wherever he is needed... 😃 😃 😃

> [@DetlevD](#):
>
> You can insert one or more comments into a regular expression ...  
> [http://www.regular-expressions.info/comments.html](http://www.regular-expressions.info/comments.html)
> 
> DD.20121027.1146.CEST

Nice ideas DetlevD, Thank you...

---

<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:24pm UTC](https://community.mp3tag.de/t/add-explanations-in-regexp/14044/11 "2026-02-09T12:24:08Z")

</div>


