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.
Oct 16 2003, 19:47
Post
#1
|
|
![]() Developer Group: Admin Posts: 7621 Joined: 12-December 01 From: Germany, Dresden Member No.: 203 Mp3tag Version: 2.55a |
This thread collects some useful regular expressions.
If you created a regular expression which solves a common task, please post it here and give a short description what it is supposed to do. These regular expressions can be used with the action type Replace with regular expression. Please look at FAQ: How do I create a new action? to learn more about actions in Mp3tag. -> If you have problems with a regular expression, please open a separate topic. -------------------- |
|
|
|
![]() |
Dec 6 2010, 01:09
Post
#2
|
|
![]() Member Group: Full Members Posts: 14 Joined: 31-March 10 Member No.: 12175 Mp3tag Version: 2.51 |
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") This didn't work for me. I tried to make my own and came up with this simple RegEx to get the cases right in my tags: REGULAR EXPRESSION: \b(?<!')(\w) REPLACE WITH: \u\1 This works for me. You can apply this to the _ALL field but be aware that this capitalizes your extensions too. If this looks somehow annoying to you (as it does to me), simply apply this to the _FILENAME field afterwards: REGULAR EXPRESSION: \.([^\.]+)$ REPLACE WITH: .\L\1\E These are both pretty simple but I spent quite a time figuring out how to make these apply for Unicode. I finally found out that Mp3tag has Unicode functionality standardly implemented into its RegEx engine. Heh. Edit: Here's some improvement. The last one only replaced the first letter of the word and put it into upper case disregarding the rest of the word. This one also puts those that follow the first letter into lower case ("DAItro" becomes "Daitro"): REGULAR EXPRESSION: \b(?<')([a-zA-Z])([^']*?)\b REPLACE WITH: \u\1\L\2\E This next one is basically the same but takes note of the French article L' and puts the letter following the article into upper case. So, for example, "L'eau" becomes "L'Eau". REGULAR EXPRESSION: \b(?<!(?<!\s[Ll])')([a-zA-Z])([^']*?)\b REPLACE WITH: \u\1\L\2\E This post has been edited by InspectorMustache: Dec 6 2010, 12:58 |
|
|
|
Florian Regular Expressions Oct 16 2003, 19:47
Florian Re: Regular Expressions Oct 16 2003, 19:52
areve Re: Regular Expressions Oct 16 2003, 20:42
gingernob QUOTE (areve @ Oct 16 2003, 21:42) Regula... Jun 19 2011, 18:06
areve Here is another one.
I don't think it will be ... Dec 4 2003, 20:05
phoenixdarkdirk This regular expression fixes tracknumbers from iT... Apr 11 2004, 20:50
areve Another one, that switches first and last names (f... May 30 2004, 21:20
incifinci Switches first and last names
QUOTE (areve ... Feb 19 2010, 10:24
mll Used to use this basic regexp :
Applied on TRACK,... Jul 14 2004, 10:27
ThurstonX If you have a filename:01 Tracknameand want it to ... Jul 31 2004, 23:34
RevRagnarok I've noticed a lot of these RegExs 'go ove... Nov 18 2004, 12:23
Florian RevRagnarok,
QUOTE (RevRagnarok @ Nov 18 200... Nov 18 2004, 14:34
nickless This RegEx will convert abbreviations composed of ... Mar 29 2005, 22:22
ThurstonX Title Tag Conversion
This 2-step action does:
1.... Oct 15 2005, 02:01
dano Upper case for Roman numbers
Regular expression:
... Dec 28 2005, 16:12
Snykch Convert artist names in the form 'Artist, The... Feb 19 2006, 15:35
Michaelm And the other way around
Move "The " to... Apr 22 2006, 13:56
Fan o blues It's taken me far too long to figure it out bu... Mar 25 2007, 20:05
Craig QUOTE (Fan o blues @ Mar 25 2007, 19:05) ... Mar 14 2009, 14:59
neilpa This regex can remove/replace all but the last dot... Nov 20 2007, 07:16
Nathan I recently converted all my wma files to mp3 only ... Jan 22 2008, 01:13
Harakiri Another member helped me creating one of the most ... Sep 1 2008, 23:02
KCE Really simple but this will remove any parenthesis... Oct 24 2008, 23:08
Lebon14 QUOTE (KCE @ Oct 24 2008, 17:08) Really s... Nov 8 2009, 05:23
captainmidnight I dislike it when a leading zero appears in the tr... Dec 5 2008, 04:56
captainmidnight Actually, here is a single regex that does everyth... Dec 5 2008, 05:17
Florian I've split some off-topic posts to Problem wit... Nov 8 2009, 20:43
MatthiasM This is not a regular expression for mp3tag, but a... Nov 19 2009, 10:48
Zoofield These are my Reg-Expressions there may be duplicat... Jun 27 2010, 19:34
d003232 My title and/or filename looks like:
Gospel&s... Aug 16 2010, 11:38
DetlevD QUOTE (d003232 @ Aug 16 2010, 12:38) ...G... Aug 16 2010, 17:22
RevRagnarok QUOTE (d003232 @ Aug 16 2010, 06:38) I do... Aug 17 2010, 13:57
DetlevD Roman numerals in uppercase
This "Regular Ex... Aug 31 2010, 10:33
DetlevD Splitting an "Upper Camel Case" string
... Sep 17 2010, 18:02
Juozas V Script to fix capitalization according to English ... Dec 15 2010, 02:39
Doug Mackie To Juozas V:
Thank you very much for this. It doe... Jan 13 2011, 19:55
DetlevD Regular Expression Tutorial
Beginner or Professio... Jan 10 2011, 19:09
pone ZITAT(DetlevD @ Jan 10 2011, 19:09) Regul... Jan 10 2011, 21:02
DetlevD QUOTE (pone @ Jan 10 2011, 21:02) Are all... Jan 10 2011, 21:09
LosMintos Convert MP3tag's date to ISO date
Converts (e... Apr 18 2011, 20:55
Zoofield I could not get, "DetlevD - Splitting an Uppe... Jun 10 2011, 22:17
tobi06 To remove any website in the filename
example: ... Jun 18 2011, 11:01
dano I've added an example without dash to that pos... Jun 19 2011, 20:14
gingernob QUOTE (dano @ Jun 19 2011, 21:14) I'v... Jun 20 2011, 01:39
DetlevD Convert from RFC822/1123 Date string to ISO-8601 D... Aug 1 2011, 05:03
DetlevD How to copy a list of artists and their roles ...
... Aug 24 2011, 15:55
pone ZITAT(DetlevD @ Aug 24 2011, 16:55) ... Aug 24 2011, 16:29
DetlevD QUOTE (pone @ Aug 24 2011, 17:29) What is... Aug 24 2011, 16:48
naisanza If you want to add TEXT to the existing tag:
Regu... Feb 8 2013, 00:55
RevRagnarok QUOTE (naisanza @ Feb 7 2013, 18:55) Regu... Apr 5 2013, 10:41
dano It's not a bug.
It happens because global matc... Apr 5 2013, 13:39![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 15:11 |