so with most things it works as expected so... from "a new flame"
becomes from "A New Flame"
but... from "wednesday morning, 3 a.m."
becomes from "WednesdaY mOrning
Just to clarify; I'm wanting to capitalise everything within the " marks. I'm sure theres something simple I've missed and it's the , thats causing the trouble. Just don't know why and the (seemingly) random capitals are really weird!
If you want to modify the format of a complete field, I would use an action of the type "Format tag-field", in this case for COMMENT.
Format string: $caps(%comment%)
... and you should consider, whether it is allowed to apply a Mp3tag scripting function like $caps() within the replacement part of the Action "Replace using Regular Expression".
Your example let assume that the embedded function $caps uses the part of the $1 parameter, following the comma, as the second parameter for its own parameter list.
Therefore the characters 'a' and 'm' and the other ones trigger the upcasing of the following letter, ...
e. g. from 'mo' to 'mO'.
The expression $caps($1) will be resolved to ... $caps(from "wednesday morning, 3 a.m.").
Therefore the function $caps works as designed: ...
change each letter to upcase character when following one character, ...
which is defined in the character set ' ."3am' (space,dot,double-apostrophe,3,a,m).
Therefore the output is ... from "WednesdaYmOrning"
This looks correct.
Upcase all characters, which are enclosed in double apostrophes at end of the given string ...
Action: Format valueField : COMMENTFormatstring:$regexp(%COMMENT%,'^(.+?)(".+?")$','$1\U$2')From: from "wednesday morning,3a.m."To : from "WEDNESDAY MORNING,3A.M."
Upcase each character, when it has a leading space, double-apostrophe, point character ...
Action: Format valueField : COMMENTFormatstring:$regexp(%COMMENT%,'(?<=[ ".])(.)','\u$1$2')From: from "wednesday morning,3a.m."To : from "Wednesday Morning,3A.M."
I think you slightly (as did the other reply below yours) misread my post (or I wasn't clear).
The complete tag for comment is: from "wednesday morning, 3 a.m." - so everything in bold including the word from.
I only want to capitalist the part within "quotes".
If I can't do this then fine, but just curious why it works in some cases, but not in others. I do now have an explanation, just not sure if (a) I'm doing something Florian never intended to work or ( there is a bug which I've discovered.
The command is being interpreted as $caps(wednesday morning, 8 A.M.)
so its looking for a new word after every A and every M as well as after a . and a [space].
I have seen similar functions mentioned (such as uppercase letter in names after a Mc or Mac ... but perhaps not quite as complicated ...
I ended up adding a replace , with § before the replace with regular expression command, then afterwards replace § with , and it all works fine. Just need to remember can't use such commands where , are in the string.