# Zero Padding Numbers, Episode 2

**URL:** https://community.mp3tag.de/t/zero-padding-numbers-episode-2/13998
**Category:** Support
**Created:** [October 15, 2012, 12:07am UTC](https://community.mp3tag.de/t/zero-padding-numbers-episode-2/13998 "2012-10-15T00:07:54Z")
**Posts on this page:** 1
**Showing post:** 3

<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 15, 2012, 1:55am UTC](https://community.mp3tag.de/t/zero-padding-numbers-episode-2/13998/3 "2012-10-15T01:55:41Z")

</div>

> [@ykeyke](#):
>
> The files are like:
> 
> **123456 English Class 67.mp3  
> 654321 English Listening 23.mp3**
> 
> I need to zero pad to 3 the number after Class, and to 2 the number after Listening, so I create an action group, which contains:

You can turn on case insentive with: (?i)  
You can turn off case insentive with: (?-i)

You can place these at different intervals of your reg exp or just have one at the start of your reg exp such as '(?i)' to not worry what case the text string is.

**Padding zeros \_FILENAME:**  **EDIT: Read the OPs Problem wrong.**

_Action type:_ **Format value**  
_Field:_ **\_FILENAME**  
_Formatstring:_ **$regexp** ( **$regexp** ( **$regexp** ( **%\_filename%** ,**'^(\d{6}.+)\s+([0-9]+)$'**, **'$1 000$2'** ),**'(?i)^(\d{6}.+\s+listening\s+)\d+(\d{2})$'**, **'$1$2'** ),**'(?i)^(\d{6}.+\s+class\s+)\d+(\d{3})$'**, **'$1$2'** )

 

**Results:**

_123456 English Class 7_

_654321 English Listening 23  
123456 English Class 00000000000006  
123456 English class 07  
654321 English listening 23  
123456 English class 00000000000006_

 

> > >

 

_123456 English Class 007  
654321 English Listening 23  
123456 English Class 006  
123456 English class 007  
654321 English listening 23  
123456 English class 006_

 

If you want to change the padding at any stage just change the **(\d{2})** or **(\d{3})** where you see fit.

---

_[View the full topic](https://community.mp3tag.de/t/zero-padding-numbers-episode-2/13998)._
