Some Regex Issues

Hey guys,

I currently use this to correctly capitalize certain words:

FIELD: _ALL
REGEX: (?<!-)\s(a|an|and|as|at|by|but|for|in|of|on|or|out|the|to)(?=\s)
REPLACE MATCHES WITH: $lower($0)

I also use this to capitalize each first and last word regardless of what it is:

FIELD: _ALL
REGEX: \b(\l)(\w*?)$
REPLACE MATCHES WITH: $upper($1)$2
CASE SENSITIVE COMPARISON: Yes

I'm using this to capitalize letters after certain characters:

FIELD: ALL
CASE CONVERSION: Mixed
WORDS BEGIN FROM/AFTER ANY OF: (-
.[

The problem is this also names my files .Mp3 rather than .mp3, I need a way to tell it to not capitalize .mp3.

I also need a way to search for exactly what I type in the filter (case sensitive), at the moment it seems to throw a bunch of results back regardless of the case I use in the search.

Many thanks.

PS: Good to see the forums back :wub:

You can add an action that will re-lower the file extension using a formula like this:
_FILENAME_EXT <== $lower(%_FILENAME_EXT%)
... but I do not know how to do it in detail .. the summer abstinence put me totally away from Mp3tag scripting.

Hmm, maybe this way works ...
Actiontype 4: Replace with regular expression
Field: _FILENAME
Regular expression: ..*$
Replace matches with: \L$0

[_] Case sensitive comparison

Filter expressions

DD.20100812.1858.CEST

Thanks mate, but the regex you provided is giving me lower case after every ".", e.g. "Feat. Pogo" is becoming "Feat. pogo".

EDIT: I managed to get around this by applying my filters to album/title only then converting tag > filename.

I am glad to hear that you have managed something which works for you.

I have looked again into the problem of changing the letter case of the file extension only and have reworked my proposal:

Actiontype 4: Replace with regular expression
Field: _FILENAME
Regular expression: ^(.+)(..+)$
Replace matches with: $1\L$2

[_] Case sensitive comparison

A filename like "Some.Test.File.MP3" or "Some.Test.File.Mp3" will be converted to "Some.Test.File.mp3".

DD.20100813.1052.CEST

There is another simple solution for just lower casing the file extension using the converter "Tag - Filename".

Convert | Tag - Filename | ALT+1
Select format string
Format string:
%_FILENAME%

Because of Mp3tag's "behind the curtain" feature of formatting the file extension to lower case, a given filename of "some OTHER test file.MP3" will be converted to "some OTHER test file.mp3".

DD.20100813.1404.CEST