I am a novice at regular expressions, and MP3Tag is where I am cutting my teeth. I still find that I am wrong many more times than I am right and I don't want to use this forum to teach me how to create them. I am hoping that I have found an issue and it's not my misunderstanding.
I am attempting to parse a Comment field with the text "Before T3 After". However "T3" may be T1, T2, T3, T4, or T5. I figure that in RegEx the way you best describe that is "T[1-5]". Assuming I am correct I would then think that
"Before /3/ After"but instead I get
"Before //3 After"QUESTION #1: Why didn't that example work? Do character classes not return references?
During the next hour as I throw anything I can find at this problem (and there are so many things in RegEx) I try
$RegExp(%Comment%,^(.)T([1-5]+)(.)$,$1/$2/$3)which I still think should work (but I still might be wrong about that), it returns an error (or two):
REGEXP ERROR: Regular expressionQUESTION #2: Why did that expression return an error?
Invalid preceding regular expression
Finally, I came up with
$RegExp(%Comment%,^(.)T(\d)(.)$,$1/$2/$3)which works well enough for this time (since there will never be a T0 or T6-T9, but I don't care if there is then matching to it is OK)
QUESTION #3: Is there a better way to do what I want restricting to T[1-5]?