# Nested Regular Expression Testing

**URL:** https://community.mp3tag.de/t/nested-regular-expression-testing/2144
**Category:** Support
**Created:** [July 28, 2005, 4:01pm UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144 "2005-07-28T16:01:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![brucem0001](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@brucem0001](https://community.mp3tag.de/u/brucem0001)
#### Post date: [July 28, 2005, 4:01pm UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144/1 "2005-07-28T16:01:58Z")

</div>

**Is it Possible to perform regular expression operations on the "Find" from a previous regular expression search/replace?**

I have encountered many circumstance where it a specific string is needed to isolate the proper information. I don't always want to change all of the search string, only part of it.

**For Example:** When I am searching for _"Vol 1"_ in the album field, I desire to leave the "Vol " portion of the search string along, and only process the number, and then only when the number consists of a single digit. I can't really assume this sequence will occur only at the end of the text in the album field, so using the "Trailing Edge Anchor; $".

This leads to all sorts of possible applications for conditional test of a string based on it's length or the length of a substring.

Does anyone have a solution to this problem?

Thanks  
BruceM0001

---

<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 28, 2005, 5:13pm UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144/2 "2005-07-28T17:13:19Z")

</div>

I'm not really sure, if I understand you, but you can

- write the result of a previous regular expression to a temporary tag field, 
- process its content in another regular expression, 
- format an existing field using the content of the temporary field and 
- finally delete the temporary field

Best regards,  
~ Florian

---

<div class="post-metadata">

### Author: ![nickless](https://community.mp3tag.de/user_avatar/community.mp3tag.de/nickless/32/36_2.png) [@nickless](https://community.mp3tag.de/u/nickless)
#### Post date: [July 28, 2005, 10:29pm UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144/3 "2005-07-28T22:29:03Z")

</div>

> [@](#):
>
> I have encountered many circumstance where it a specific string is needed to isolate the proper information. I don't always want to change all of the search string, only part of it.

I'm not sure, if I understood you too, but if you want to find a special string containing a number of substrings in **one** field and change **one** of this substrings with **a single** RegEx operation, you can access each match, marked by two brackets () by $n, where n is a number of match, and change only them.

Your Example (?):  
find all "vol. 1"/"vol. 2"... and change the 1, 2, 3... in them , for example to [01], [02] ...  
RegEx: (vol. )(\d{1})($|\D+)  
Replace with: $1[0$2]$3

---

<div class="post-metadata">

### Author: ![brucem0001](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@brucem0001](https://community.mp3tag.de/u/brucem0001)
#### Post date: [July 30, 2005, 7:52pm UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144/4 "2005-07-30T19:52:56Z")

</div>

Nickless,  
Thank you for your suggestion. I will give it a try. But while on the subject of "Finds" in a "Replace With Regular Expression" action, What is the scope of the "Find" result? Example: If I search for a specific portion of a string and that "Find" is contained within $3 (for example), is $3 still usable in the next line of the overall "Named Action", or is it's value good only within the "Action Line" where the search was made?

> [@](#):
>
> I'm not sure, if I understood you too, but if you want to find a special string containing a number of substrings in **one** field and change **one** of this substrings with **a single** RegEx operation, you can access each match, marked by two brackets () by $n, where n is a number of match, and change only them.
> 
> Your Example (?):  
> find all "vol. 1"/"vol. 2"... and change the 1, 2, 3... in them , for example to [01], [02] ...  
> RegEx: (vol. )(\d{1})($|\D+)  
> Replace with: $1[0$2]$3
> 
> \<{POST\_SNAPBACK}\>

---

<div class="post-metadata">

### Author: ![nickless](https://community.mp3tag.de/user_avatar/community.mp3tag.de/nickless/32/36_2.png) [@nickless](https://community.mp3tag.de/u/nickless)
#### Post date: [July 31, 2005, 11:01am UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144/5 "2005-07-31T11:01:25Z")

</div>

> [@](#):
>
> ...What is the scope of the "Find" result? Example: If I search for a specific portion of a string and that "Find" is contained within $3 (for example), is $3 still usable in the next line of the overall "Named Action", or is it's value good only within the "Action Line" where the search was made?

The "Finds" are available only within one "Action line", but I think various small RegEx actions can allways be replaced with bigger one (do you know an example when it's impossible without previous finds?).  
If you want to do s.th else with some parts of search result you can do it in "Replace with", for example replace with "$1$upper($3)$2".

Regards  
nickless

---

<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:19pm UTC](https://community.mp3tag.de/t/nested-regular-expression-testing/2144/6 "2026-02-09T12:19:25Z")

</div>


