# Need help trimming characters

**URL:** https://community.mp3tag.de/t/need-help-trimming-characters/14219
**Category:** Support
**Created:** [December 11, 2012, 11:30pm UTC](https://community.mp3tag.de/t/need-help-trimming-characters/14219 "2012-12-11T23:30:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![EB\_Joe](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/b9e5f3/32.png) [@EB\_Joe](https://community.mp3tag.de/u/EB_Joe)
#### Post date: [December 11, 2012, 11:30pm UTC](https://community.mp3tag.de/t/need-help-trimming-characters/14219/1 "2012-12-11T23:30:32Z")

</div>

Until a couple weeks ago, I had the regex's to trim x number of characters at y position from the left and right side of the string. Then, my HD went toes up and I had to restore from a month-old backup, and lost them. Can somebody help? I cannot figure out how they went. I'll give you an example of what I want it to do.

String: abcdefghijklmonpqrstuvwxyz  
trim 11 characters from the left at position 10

result:

String: abcdefghijvwxyz

trim 5 characters from the right at position 2

result:

String: abcdefghijklmonpqrsyz

Any help?

---

<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: [December 11, 2012, 11:53pm UTC](https://community.mp3tag.de/t/need-help-trimming-characters/14219/2 "2012-12-11T23:53:21Z")

</div>

> [@EB Joe](#):
>
> String: abcdefghijklmonpqrstuvwxyz  
> trim 11 characters from the left at position 10
> 
> result:
> 
> String: abcdefghijvwxyz

**Regexp: ^(.{10}).{11}(.+)**  
**Replace: $1$2**

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

> [@EB Joe](#):
>
> trim 5 characters from the right at position 2
> 
> result:
> 
> String: abcdefghijklmonpqrsyz

**Regexp: (.+).{5}(.{2})$**  
**Replace: $1$2**

 ![](https://community.mp3tag.de/uploads/default/original/2X/5/5619615f372de5b1eb98f0a5a476f56c8531abdb.jpg)  

Notice how the two regexp work in both attachments. Pay close attention to the anchors **^** and **$**.

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

 ![](https://community.mp3tag.de/uploads/default/original/2X/5/5619615f372de5b1eb98f0a5a476f56c8531abdb.jpg)

---

<div class="post-metadata">

### Author: ![EB\_Joe](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/e/b9e5f3/32.png) [@EB\_Joe](https://community.mp3tag.de/u/EB_Joe)
#### Post date: [December 12, 2012, 12:27am UTC](https://community.mp3tag.de/t/need-help-trimming-characters/14219/3 "2012-12-12T00:27:32Z")

</div>

Thank you very much, that works great. And yes, I need to pull my head out when it comes to anchors.

Now, I have saved the config to another drive with it's own backup, and to my data backup flash drive, so i don't have to ask again 😆

now, to continue ![:book:](https://community.mp3tag.de/uploads/default/original/1X/0036d5b68f6226c53f6c68abfd0a7b8096fd4505.gif ":book:") so i can learn more.

---

<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: [December 12, 2012, 12:39am UTC](https://community.mp3tag.de/t/need-help-trimming-characters/14219/4 "2012-12-12T00:39:22Z")

</div>

Glad it works for you.

The world is now your oyster [http://www.regular-expressions.info](http://www.regular-expressions.info/tutorialcnt.html)

See anchors listed on the side menu.

---

<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/need-help-trimming-characters/14219/5 "2026-02-09T12:24:13Z")

</div>


