Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.
Also make sure you've read the Forum Guidelines before posting in this forum.
![]() ![]() |
Feb 12 2011, 08:45
Post
#1
|
|
|
Member Group: Full Members Posts: 8 Joined: 26-September 08 Member No.: 7626 Mp3tag Version: v2.41 |
Hey guys,
I'm in the process of trying to teach myself regular expressions and I ran into some trouble and can't seem to resolve. I have an Artist tag of this format: blah «blah« I would like to capitalize the first letter of the second blah (which is surrounded by « chars). For example if my tag is VIA «raccoons« I want it to become VIA «Raccoons« So put simply, I'm trying to reference the first letter that follows the character '«' and capitalize it. I tried the following regular expression: Regular expression: »(.?)([\w]+) Replace with: $caps3($1)$2 So what I (think) the above is saying is: after the '»' character, match any single character (repeat this zero or one times only), then for a second reference match any character. For the replacement, capitalize the first match ($1) and leave the second match untouched. As you can see, this regular expression stuff has got me rather confused, don't even know what's up or down anymore Thanks in advance for the help! Max |
|
|
|
Feb 12 2011, 10:22
Post
#2
|
|
![]() Moderator Group: Moderators Posts: 5500 Joined: 4-September 03 From: Germany Member No.: 201 Mp3tag Version: 2.55a |
Please check if you need » or «
Regular expression: «(.?)(\w+) Replace with: «$caps3($1)$2 or Regular expression: «(\l) Replace with: «$caps3($1) [x] case-sensitive comparison -------------------- |
|
|
|
Feb 12 2011, 13:10
Post
#3
|
|
![]() Member Group: Full Members Posts: 1571 Joined: 15-March 09 From: Germany Member No.: 9103 Mp3tag Version: 2.50 |
i don't know if it fits all your cases, but for the example above, the following would be less complicated:
Action: Format Value Field: FIELDNAME Formatstring: $caps2(%fieldname%,«) Please replace FIELDNAME/%fieldname% with the name of the field you are talking about. This post has been edited by pone: Feb 12 2011, 13:13 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 11:17 |