# help with a "found" regex

**URL:** https://community.mp3tag.de/t/help-with-a-found-regex/11088
**Category:** Support
**Created:** [November 8, 2010, 9:22pm UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088 "2010-11-08T21:22:13Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Lee\_Dailey](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lee_dailey/32/4832_2.png) [@Lee\_Dailey](https://community.mp3tag.de/u/Lee_Dailey)
#### Post date: [November 8, 2010, 9:22pm UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/1 "2010-11-08T21:22:13Z")

</div>

howdy y'all,

i found this post ...  
[Feature Request - Title Casing](https://community.mp3tag.de/t/2086/4)

... containing this regex ...  
\s(The|Tha|Da|To|Of|By|For|From|A|An|As|And|At)(?= )

i THINK it matches any of the words between the 1st set of () that are capitalized and have both ONE leading and ONE trailing space.

is that correct? i've currently got a passel of "replace" commands in an action that this would appear to allow me to replace with one line.

take care,  
lee

---

<div class="post-metadata">

### Author: ![Lee\_Dailey](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lee_dailey/32/4832_2.png) [@Lee\_Dailey](https://community.mp3tag.de/u/Lee_Dailey)
#### Post date: [November 9, 2010, 2:29am UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/2 "2010-11-09T02:29:47Z")

</div>

howdy y'all,

found another that confuses me. [_grin_] this one does "O'Brien" style names.

(^|\s|"|(|[|/)O'([^e]{1})  
$1O'$upper($2)

i THINK (^|\s|"|(|[|/) means ...  
anything before \>O'\< that is found at the beginning of field or after a space, a double quote, "(", "[" or "/". ends up in the variable $1.

i don't understand what the ([^e]{1}) part does tho. it looks like "the 1st non-letter-e after the \>O'\<". the result ends up in variable $2.

help, please?

take care,  
lee

---

<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: [November 9, 2010, 4:50am UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/3 "2010-11-09T04:50:20Z")

</div>

> [@Lee\_Dailey](#):
>
> ... i don't understand what the ([^e]{1}) part does ...

Learn from there ...  
[http://www.regular-expressions.info/charclass.html](http://www.regular-expressions.info/charclass.html)

DD.20101109.0650.CET

---

<div class="post-metadata">

### Author: ![Lee\_Dailey](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lee_dailey/32/4832_2.png) [@Lee\_Dailey](https://community.mp3tag.de/u/Lee_Dailey)
#### Post date: [November 9, 2010, 5:42am UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/4 "2010-11-09T05:42:56Z")

</div>

> [@DetlevD](#):
>
> Learn from there ...  
> [http://www.regular-expressions.info/charclass.html](http://www.regular-expressions.info/charclass.html)
> 
> DD.20101109.0650.CET

howdy DetlevD,

i followed one of your earlier links to that site. thanks! [_grin_]

still, i am confused at what ([^e]{1}) does. i THINK it matches the 1st non-letter-e after the \>O'\<, but i aint sure of that. could you / would you elucidate?

i finally found out about "lookaround" stuff - (?= ) - at that site so i don't need clarification on the 1st post in this thread.

take care,  
lee

---

<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: [November 9, 2010, 8:26am UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/5 "2010-11-09T08:26:32Z")

</div>

> [@Lee\_Dailey](#):
>
> ... i found this post ...  
> [Feature Request - Title Casing](https://community.mp3tag.de/t/2086/4)  
> ... i THINK it matches any of the words between the 1st set of () that are capitalized and have both ONE leading and ONE trailing space.  
> is that correct? ...

To check something for correctness, especially a Regular Expression, you should always create some example test cases with positive and negative results, to make sure, that the process works as you think and expect.

Look at the following expression. You can put it into the "Format string" edit field of the "Tag - Filename" dialog and the result is given into the "Preview" area.

$regexp('The Letter A At The Word And Is Often An Error From Da Writing And Should Be Replaced By Tha Letter E','\s(The|Tha|Da|To|Of|By|For|From|A|An|As|And|At)(?=\s)','\L $1')

Result:  
The Letter a at the Word and Is Often an Error from da Writing and Should Be Replaced by tha Letter E.

It is obvious what the Regular Expression does and what not.

DD.20101109.1023.CET

---

<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: [November 9, 2010, 9:56am UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/6 "2010-11-09T09:56:17Z")

</div>

> [@Lee\_Dailey](#):
>
> ... still, i am confused at what ([^e]{1}) does. ...

Exclude the case "O'er" to become "O'Er".

DD.20101109.1156.CET

---

<div class="post-metadata">

### Author: ![Lee\_Dailey](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lee_dailey/32/4832_2.png) [@Lee\_Dailey](https://community.mp3tag.de/u/Lee_Dailey)
#### Post date: [November 9, 2010, 6:10pm UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/7 "2010-11-09T18:10:03Z")

</div>

howdy DetlevD,

thanks! so i got the ([^e]{1}) part correct. it helped to see what it was testing for. too bad my imagination simply never went that far.

"obvious" is relative. to me, your examples take several run-thrus to figure out and i'm often left wondering if i really got it.

again, thanks for your help!

take care,  
lee

---

<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:22pm UTC](https://community.mp3tag.de/t/help-with-a-found-regex/11088/8 "2026-02-09T12:22:40Z")

</div>


