# Insert text with a regular expression in the filename

**URL:** <https://community.mp3tag.de/t/insert-text-with-a-regular-expression-in-the-filename/60079>\
**Category:** Support\
**Created:** [February 15, 2023, 4:31pm UTC](https://community.mp3tag.de/t/insert-text-with-a-regular-expression-in-the-filename/60079 "2023-02-15T16:31:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 15, 2023, 4:37pm UTC](https://community.mp3tag.de/t/insert-text-with-a-regular-expression-in-the-filename/60079/2 "2023-02-15T16:37:12Z")

</div>

> [@ragtag](#):
>
> **Regular expression: ^\d**

If you want to keep the number, then you have to tell MP3tag that it should remember it - which is done by enclosing the pattern in parenthesis.  
So for something like  
101. My music file  
which should become  
1-01. My music file  
Try:  
Search pattern: `^(\d)(.*)`  
Replace string: `$1-$2`

Further information about regular expressions can be found in the documentation:

> **[Regular Expressions – Mp3tag Documentation](https://docs.mp3tag.de/regex/)**
>
> Documentation on support for regular expressions in Mp3tag. Mp3tag is the universal Tag Editor.

---

_[View the full topic](https://community.mp3tag.de/t/insert-text-with-a-regular-expression-in-the-filename/60079)._
