This RegEx will convert abbreviations composed of single chars and points between (and/or behind it) to uppercase.
Single chars without points around remains lowercase, except if a "-"char and a space is before it. (Example: "Songname - A text")
First step:
Format Value
Field: TITLE
Formatstring: %_FILENAME%
Second step:
Set a new Replace with Regular Expression action
Field: TITLE
Regular expression:
^([0-9]+)\s*-\s*
Replace matches with:
$1. $2
I use the first format for all file names, but my iRiver displays the title tag, which looks better (and saves one character) using the latter. For me it's a 2-step process: Filename-to-Tag (%TITLE% only) and then convert Title tag. Assumes your filename is the way you want it, of course.
It's taken me far too long to figure it out but I've finally got it working.
To change Horne, Lena to Lena Horne or
Hawkins, Coleman With Manny Albam & His Orchestra to Coleman Hawkins With Manny Albam & His Orchestra
Field: ARTIST
Regular Expression: ^([\w]+),\s([\w]+)
Replace Matches with: $2 $1
I hope I didn't miss the answer in here somewhere. If there's an easier or better way please feel free to help.
This regex can remove/replace all but the last dot from a string. It's useful for people like me who prefer to limit filename chars to a-z, 0-9, '_', and '-'. We need to save that last dot for file extensions.
I recently converted all my wma files to mp3 only to realize that all the tags were lost. My music is in the form:
...\artist\album\track title.mp3
MP3TAG came to my rescue! Not sure whether there was an easier way to do this, but I got started by reading this. Sorry if these are lame ways of doing it, but it's my 1st experience with regexp.
format artist: $regexp(%_folderpath%,.+\\(.+)\\(.+)\\,$1)
format album: $regexp(%_folderpath%,.+\\(.+)\\(.+)\\,$2)
Next 2 I got from ThurstonX in this post.
format track: $regexp(%_filename%,(\d*)\s?(.+),$1)
format title: $regexp(%_filename%,(\d*)\s?(.+),$2)
I dislike it when a leading zero appears in the track number of the track tag (or when the total track count is added after a '/' char).
[Aside: It seems like a bad idea to pollute a nice simple tag like the track with extra information like this. My intuition is that the information in each tag should be kept as simple and pure as possible. In databases there is a similar concept: you usually want to achieve what is called a normalized design. But if someone has a good reason for doing otherwise, please educate me!
Note that I only have a problem with leading zeroes in the track TAGS. In contrast, when I use tracks in filenames, I DO like a leading zero if there are > 9 tracks on the CD because that causes the filenames to be lexicographically ordered, which is critical for proper sorting by your file system, as well as it visually looks better when filenames are displayed in a list.]
Earlier in this thread, phoenixdarkdirk pointed out how to remove any '/' char and following digits.
Here is how to remove any leading zeroes (as well as trimmable whitespace):
Actually, here is a single regex that does everything that I want:
Regex:
\s*0?(\d+)(\s*/\s*\d+)?\s*
Replace with:
$1
[/quote]
This will remove any trimable whitespace around the number (which will be the track tag in my case), remove any leading zero from the number, and remove any suffix after the number that starts with a '/' char (e.g. the total track count).
I've just spent a while figuring this out myself, and came on here to post it only to find someone else already has
Mine is quite similar
Filed: ARTIST
RegExp: ^(.+),\s+(\w*)
Replace With: $2 $1
Variant A
It will not change those artists, where the conversion already done (artist has comma).
Example: Brel, Jacques William remains Brel, Jacques William
Variant B
It handles multipled for WMP artists (in format "artist1/artist2/artist3"), possible nicknames at the end in square brackets and trims unnecessary white spaces.
Example:
Elvis Presley /Brel, Jacques/ Gabriele Susanne Kerner [Nena ]
will
Presley, Elvis/Brel, Jacques/Kerner, Gabriele Susanne [Nena]
Action group
action: regular expression (trim white spaces)
Field: ARTIST
Regular expression: ^\s+|\s+$
Replace with: (nothing)
action: regular expression (multiple white spaces replace to 1)
Field: ARTIST
Regular expression: \s{2,}
Replace with: " " (whitout quotation marks)
action: replace (delete white space after opening bracket)
Field: ARTIST
Original: "[ " (whitout quotation marks)
Replace with: [
action: replace (delete white space before closing bracket)
Field: ARTIST
Original: " ]" (whitout quotation marks)
Replace with: ]
action: split fields by separator (for the next actions)
Field: ARTIST
Separator: /
action: regular expression (switches names without nickname)
Field: ARTIST
Regular expression: ^([^,[]+)\s([^,[]+)$
Replace with: $2, $1
action: regular expression (switches names with nickname)
Field: ARTIST
Regular expression: ^([^,[]+)\s([^,[]+)\s(\[.+\])$
Replace with: $2, $1 $3
action: merge duplicate fields (...back)
Field: ARTIST
Separator: /
These are my Reg-Expressions there may be duplicates to what have previously been posted, or there are small changes to fix the many errors that the posted Reg-Expressions create. I have done a lot of testing to make sure these do what they say they do and nothing else. I hope this also allows me a place to create a back up.
Thank-you! Updated: (June/10/2011) Mp3tag 2.49
Action Group:Aa
RE: Remove track number from title, ex."1 - Title" < "Title".
Field:TITLE
re:^\s*\d+\s*-\s*
Nothing:
RE: Remove "The" from artist, ex."The Artist" < "Artist".
Field:ARTIST
re:^The\s+
Nothing:
Case conversion:
Field:_TAG
Case conversion:Mixed Case
/[({"-_
RE:Capitalize Roman Numerals up to 399. (trimmed down from 3999
RE:to reduce false positives) - <a href="http://bit.ly/lZdZsj" target="_blank">http://bit.ly/lZdZsj</a>
Field:_Tag
re:(?<!')\b(?=[CLXVI])((C{0,3})?((X[LC])|(L?X{0,3})|L)?((I[VX])|(V?(I{0,3}))|V)?)\b
$upper($0)
RE: Capitalize Zero stop Acronyms and Initialisms. - <a href="http://bit.ly/jADbI6" target="_blank">http://bit.ly/jADbI6</a>
Field:_Tag
re:(?:frowning:?<=[^\w\']|\_)|(?<=^))(ac|ad|afi|aol|asap|atm|bbc|bc|bce|blt|btw|cc|cia|crc|cst|csv|dc|dfa|dj|d
mv|doa|dst|eod|ep|est|et|faq|fbi|fm|gi|glc|gmo|imo|imho|iq|ira|jc|irs|krs|la|lp|
m
c|mst|mtd|nasa|oj|pc|pi|pj|pm|ps|qed|rv|sos|ssr|usa|ussr|tba|tbd|teotwawki|tlc|t
v
|ufo)(?=[^\w\']|\_|$)(\.*)
$upper($1)
RE: Capitalize the Letter Infront of a period. A.B.C.
Field:_Tag
re:(?<=\.)([^\W\d\_])
$upper($1)
RE: Capitalize the Letter Infront of a Space and Apostrophe.
Field:_Tag
re:(?<=\s')([^\W\d\_])
$upper($1)
RE: Lower Case Prepositions, Articles and, Coordinating Conjunctions.
Field:_Tag
re:(?<=\w\s)(a|as|at|an|about|above|across|after|against|along|alongside|although|amo
ng|and|around|as|at|because|before|behind|below|beneath|beside|between|beyond|bu
t
|by|de|despite|down|during|even|except|excepting|for|from|if|in|inside|into|like
|
near|next|nor|of|off|on|onto|or|out|outside|over|past|regarding|round|since|so|t
h
an|the|through|throughout|till|to|toward|under|underneath|unlike|until|up|upon|v
o
n|when|while|with|within|without|yet)(?=\s\w)
$lower($0)
RE: Lower Case Abbreviations, Add Stop.
Field:_Tag
re:(?<=[^\w\']|\_)(alt|ave|capt|cent|corp|div|ed|eg|etc|fag|feat|gen|hr|ie|inc|inst|lb|ltd|
min|mt|op|pl|pop|pseud|pt|pub|rev|sec|ser|sgt|st|univ|vs|vol)(?=[^\w\']|\_)(\.*)
$lower($1).
RE: Add Space Before, & ( { [ + =
Field:_Tag
re:([^\W\_])([&\(\{\[\+\=])
$1 $2
RE:Add Space After, & ) } ] ; : , ! + =
Field:_Tag
re:([&\)\}\]\;\:\,\!\+\=])([^\W\_])
$1 $2
RE: Add Space After, . <a href="http://bit.ly/jADbI6" target="_blank">http://bit.ly/jADbI6</a>
Field:_Tag
re:(?<!^)(?<!\d|\s|\.)(\.)([^\W\d\_])(?!\.|\s|$)
$1 $upper($2)
RE: Add Space After, " "
Field:_Tag
re:(".*?")([^\W\_])(?!$)
$1 $2
RE: Add Space Before, " "
Field:_Tag
re:([^\W\_])(".*?")
$1 $2
RE: Remove Spaces After, ( [ { Before, ] } ) ? : ; , ! .
Field:_Tag
re:([\(\[\{])\s+|\s+([\]\}\)\?\:\;\,\!\.])
$1$2
RE: Remove Spaces Before / After.
Field:_Tag
re:\s+(\/)\s+
$1
RE: Remove Spaces inside, " "
Field:_Tag
re:"\s*(.*?)\s*"
"$1"
RE: Remove Spaces Before and After String.
Field:_Tag
re:^\s+|\s+$
Nothing:
RE: Remove all Double+ Spacing.
Field:_Tag
re:\s{2,}
One Space:
RE: Add Apostrophe to Are Contractions.
Field:_Tag
re:\b(how|they|what|when|where|why|you)re(?=[^\w\']|\_|\$)
$1're
RE: Add Apostrophe to Had/Would Contractions.
Field:_Tag
re:\b(he|how|i|it|she|they|we|what|where|who|why|you)d(?=[^\w\']|\_|\$)
$1'd
RE: Add Apostrophe to Have Contractions.
Field:_Tag
re:\b(could|how|i|might|must|should|we|what|when|where|would|you)ve(?=[^\w\']|\_|\$)
$1've
RE: Add Apostrophe to Is Contractions.
Field:_Tag
re:\b(he|here|how|it|let|she|that|there|two|what|when|where|who|why)s(?=[^\w\']|\_|\$)
$1's
RE: Add Apostrophe to Not Contractions.
Field:_Tag
re:\b(ain|aren|can|couldn|didn|doesn|don|hadn|hasn|haven|isn|mightn|mustn|shoul
dn|wasn|weren|won|wouldn)t(?=[^\w\']|\_|\$)
$1't
RE: Add Apostrophe to Will Contractions.
Field:_Tag
re:\b(how|i|it|she|that|there|they|what|when|where|who|why|you)ll(?=[^\w\']|\_|\$)
$1'll
RE: Add Apostrophe to Am Contractions.
Field:_Tag
re:\b(i)m(?=[^\w\']|\_|\$)
$1'm
RE: Add Apostrophe to Do Ya Contraction.
Field:_Tag
re:\b(D)ya(?=[^\w\']|\_|\$)
$1'ya
RE: Add Apostrophe to Do You Contraction.
Field:_Tag
re:\b(D)you(?=[^\w\']|\_|\$)
$1'you
RE: CamelCase Mc Words.
Field:_Tag
re:\bMc(?=.)
Mc$upper($1)
RE:CamelCase O' Words.
Field:_Tag
re:\bO'([^\W\d\_e])
O'$upper($1)
This is a good example for the situation, where someone does not really need to learn the regular expression language, but instead use a simple action.