Capitalizing sentence with commas inside parentheses

Hello fellow members. Long time no see!

I'm trying to capitalize only the first letter of the following strings inside parentheses:

4:47AM (The Remains of Our Love)

5:01AM (The Pros and Cons of Hitch Hiking, Pt. 10)

The regex i have been trying to figure out:

(.+)(?=\s()\s?((([a-zA-Z0-9 .,]+?)))

The first title is parsed correctly but the second is parsed in mixed case supressing all the characters that follow the comma:

The pRos And Cons Of HitCh Hiking

Could you help me figure out where i did go wrong with my regex?

Thank you.

Somehow I am missing how you treat the result.
Or: I can see the source string - but what should the target string look like?
Also, I am used to regular expressions that use a $1 etc. as result output unless you want to delete something.
When I test
$regexp('5:01AM (The Pros and Cons of Hitch Hiking, Pt. 10)',(.+)(?=\s()\s?((([a-zA-Z0-9 .,]+?))),$1)
I get a syntax error.
So: does the forum formatter show everything correctly? It may be advisable to enclose the expression in accent grave.

Hi ohrenkino!

image

image

Outputs:

The pRos And Cons Of HitCh Hiking

The expected result should be:

5:01AM (The pros and cons of hitch hiking, pt. 10)

Doesn't this problem resemble a little this one:

You describe a pattern with 3 parts but only the third gets treated.
I do not think that you can "replace" that but you have "Format value" the field again with a separate string function for each part that you then have to isolate with a regular expression each.
If you use $caps() you may have to define the characters that determine the word separator.
I tried the following:
$caps3($regexp('5:01AM (The Pros and Cons of Hitch Hiking, Pt. 10)','(.+) (\(.)(.*,.*\))',$1 $2$3),'(')
and got
5:01am (The pros and cons of hitch hiking, pt. 10)

In my example i isolated the third part for testing purposes only. Although your explanation makes sense i'm still trying to understand why this method is not suitable for achieving such result:

image

I tried it in Convert>Tag-Tag with $regexp()
I am not quite sure if the preview works allright because that never shows any case conversion ...
Please not that I appended function to
$caps3($3,'(')
to set the ( as word separator.

image

image

Results in:

5:01AM (THe pRos And Cons Of HitCh Hiking)

It's the wrong part that gets the $caps-treatment. It should be $2

My apologies for lack of attention though it will output a syntax error in format string.

as I said: I do not think that you can use the $-functions in a "replace with" statement as this is not a format string.
You would have to use a "Format value" action and 3 separate regular expressions to isolate the 3 parts so that you can treat the case of "Bracket plus character" individually.

I use $-functions in a similarly fashion and they usually output the desired result. I'm quite aware that my regular expressions are sub-par but they work as intended. For instance:

image

image

Trying to a workaround that somehow proves that there must something related to mp3tag that's causing this bug to happen:

image

image

Outputs:

5:01AM (THE pros and cons of hitch hiking)

So i wonder why is mp3tag supressing all the characters followed by the comma including the comma itself?

Having both regex syntax and the scripting functions (where the comma is a special character) here has limits.
So if you have a comma in your tag field it breaks the function.

I figured a workaround that satisfies both examples:

image

image