RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Milagro
Posts: 90
Joined: Sun Jun 20, 2010 7:21 am

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by Milagro »

I can not find the "RegExp Find & Replace" option in my edit menu.
I get a install error but the module is visible in the extension menu.

I am running MM 3.2.1 whit AdvancedDuplicateFindFix.3.6.2 Lyricator / SongPreviewer and SqlViewer.2.4 on Win7 64bit
And the option is not available in the "Choose Tree Nodes" option
Image (http://www.tiikoni.com/tis/view/?id=a25da92)
Last edited by Milagro on Sat Jul 17, 2010 8:53 am, edited 1 time in total.
Vyper
Posts: 845
Joined: Tue May 23, 2006 5:53 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by Vyper »

Are you running MM as administrator?

There are options in Tools -> Options for it as well.
Stop Button Freak
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by ZvezdanD »

Milagro wrote:I can not find the "RegExp Find & Replace" option in my edit menu.

I have installed the script correctly
How do you know that you have installed the script correctly, did you get the dialog box saying that? Do you have RegExpReplace.vbs file in c:\Program Files\MediaMonkey\Scripts\Auto\ folder? Did you try to restart the program?
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Milagro
Posts: 90
Joined: Sun Jun 20, 2010 7:21 am

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by Milagro »

Is it batch replacing also possible?
<String Caption="" Value="01."> to <String Caption="" Value="29.">

And is it possible to use the filename Best Of The 80's - Disc 01 - 01 - Queen - Body Language-128.mp3
To fill the Title and Artist?

And is there also a option to clean op my Artist & Album list?
Some labels are wrong by example
2Pac n Dr. Dre <> 2Pac & Dr. Dre
Aha <> A-ha
The B-52's <> The B-52s
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by ZvezdanD »

Milagro wrote:Is it batch replacing also possible?
<String Caption="" Value="01."> to <String Caption="" Value="29.">
I don't understand this. Could you be more specific?
Milagro wrote:And is it possible to use the filename Best Of The 80's - Disc 01 - 01 - Queen - Body Language-128.mp3
To fill the Title and Artist?
Yes, it is, but in that case I think it would be easier to use Auto-Tag from Filename option instead.
Milagro wrote:And is there also a option to clean op my Artist & Album list?
I am not sure that understand this either. If you want to clear the contents of those fields, you could use the predefined preset "Clear <Into Field>..." with specified field that you want to clear, but keep in mind that you could modify only one field at once.
Milagro wrote:Some labels are wrong by example
2Pac n Dr. Dre <> 2Pac & Dr. Dre
Aha <> A-ha
The B-52's <> The B-52s
You could try to customize the predefined preset "Fix specified Artist names (10cc, AC/DC, INXS, UB40)". I think it is easy and obvious, but let me know if you have a problems with that.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Milagro
Posts: 90
Joined: Sun Jun 20, 2010 7:21 am

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by Milagro »

By it batch replacing I mean cleaning up Title like:

01. The Reflex
02. Devil In The Details
03. Speak
It's not a list that go's 1 to 29 there are also double numbers like:

01. Why Do Fools Fall In Love?
01. Kyrie
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by ZvezdanD »

Milagro wrote:By it batch replacing I mean cleaning up Title like
Sorry, but I am still not sure that understand what you want. If you want to add ordinal numbers in the front of the title, you could take a look at the preset "Add ordinal number of current track with leading zero to the begin of Title". However, if your titles already has track numbers in the front of them, then you could try next settings:
Find what: ^\d+(?:\s+-|\.)\s+(.+)
Into: Title
Regular expression 1: checked
Replace with: Right("00" & lSongIndex, 2) & ". $1"
VBScript expression: checked

Actually, this is a combination of the mentioned preset with the "Remove all digits followed with " - " or ". " from the begin of <Into Field>..." preset.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Milagro
Posts: 90
Joined: Sun Jun 20, 2010 7:21 am

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by Milagro »

Yes that's what I was looking for.

But can you tell met what's wrong whit this expression?

Fix specified Artist names
^(10 cc|10 ?CC)|(Ac Dc|AC-DC|ACDC|AC DC|[Aa]c/[Dd]c)|(Inxs)|(U[Bb] ?40)|(A-ha)|(B52's|The B-52s)$
MapArray(Array("$1", "10cc","$2", "AC/DC", "$3", "INXS","$4", "UB40","$5", "Aha","$6", "The B-52's"))

the The B-52's and Aha are still in two groups and there was a combined-group I think it was called UB40The B-52's

Is it also possible to run some scripts automatically?
1 Run script 1 to 4 on the Title / Artist / Album / Album artist
2 Replace underlines with spaces in <Into Field>...
3 Replace acute and grave accents with apostrophes in <Into Field>
4 Remove month and day from release Date
5 Copy release Date to Original Date only if it is undefined
6 Clear Lyrics greater than 1 line but less than 10 lines
7 Replace "&", feat./pres./vs. with "; " in <Into Field>...
8 Fix common words (featuring, presents, versus) in <Into Field>
9 Fix common words (I'm, I'll, don't, won't, ain't, isn't, can't) in <Into Field>...
10 Fix specified Artist names (10cc, AC/DC, INXS, UB40)
11 Uppercase first letter of each line or sentence of Lyrics and lowercase others
12 Remove diacritical marks from <Into Field> (aeioucdghjklnrstywz)...



And how do I apply Fix common words (featuring, presents, versus) in <Into Field>... on Ain't Got No...I Got Life (Ft Groovefinder)
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by ZvezdanD »

Milagro wrote:But can you tell met what's wrong whit this expression?

Fix specified Artist names
^(10 cc|10 ?CC)|(Ac Dc|AC-DC|ACDC|AC DC|[Aa]c/[Dd]c)|(Inxs)|(U[Bb] ?40)|(A-ha)|(B52's|The B-52s)$
MapArray(Array("$1", "10cc","$2", "AC/DC", "$3", "INXS","$4", "UB40","$5", "Aha","$6", "The B-52's"))

the The B-52's and Aha are still in two groups and there was a combined-group I think it was called UB40The B-52's
Your expression is right and nothing is wrong. "A-ha" would be replaced with "Aha" and "B52's" or "The B-52s" would be replaced with "The B-52's". Isn't that what you want?
Milagro wrote:Is it also possible to run some scripts automatically?
Currently it is not possible, but the batch execution of presets is under development.
Milagro wrote:And how do I apply Fix common words (featuring, presents, versus) in <Into Field>... on Ain't Got No...I Got Life (Ft Groovefinder)
Well, this preset has a problem with finding words that are immediately after opening parenthesis. To resolve that you should replace \s on the begin of the Find what string with \b, and should remove " " & from the begin of the Replace with string, i.e. it should be:
Find what: \b(?:(feat\.?|featuring|features|ft\.?)|(presenting|presents|pres\.?)|(versus|vs\.?))\s
Replace with: MapArray(Array("$1", "ft.", "$2", "pres.", "$3", "vs.")) & " "
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
BrynAilyn
Posts: 5
Joined: Wed Feb 28, 2007 5:27 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM

Post by BrynAilyn »

I'm hoping you can help me. I have tried to figure this out for myself but have been unsuccesful. What I am trying to do is replace the existing "<Title>" with "<Album> - <Track#>". I can get one or the other but not both and no hyphen. I appreciate any help offered. Thanks

Brian
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM

Post by ZvezdanD »

BrynAilyn wrote:What I am trying to do is replace the existing "<Title>" with "<Album> - <Track#>".
Find what: ^.*
Into: Title
Regular expression 1: checked
Replace with: oSongData.AlbumName & " - " & oSongData.TrackOrderStr
VBScript expression: checked
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
BrynAilyn
Posts: 5
Joined: Wed Feb 28, 2007 5:27 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM

Post by BrynAilyn »

[quote="ZvezdanD"][quote="BrynAilyn"]What I am trying to do is replace the existing "<Title>" with "<Album> - <Track#>".[/quote]
Find what: ^.*
Into: Title
Regular expression 1: checked
Replace with: oSongData.AlbumName & " - " & oSongData.TrackOrderStr
VBScript expression: checked[/quote]

Rad! This worked perfectly. Is there a list of all the VB expressions? What's a good way to learn how to do this myself? Thanks tons.
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM

Post by ZvezdanD »

BrynAilyn wrote:Is there a list of all the VB expressions? What's a good way to learn how to do this myself?
I am not sure that understand what you want to know. The VBScript expressions are a combination of various variables, functions, strings and/or numbers. Such combinations could be countless. If you want to know which functions VBScript suports, then you could take a look at http://www.w3schools.com/vbscript/vbscr ... ctions.asp. There is also a general tutorial for VBScript programing language: http://www.w3schools.com/vbscript/default.asp. Inside of the VBScript expressions you could use some MM API functions as well: http://www.mediamonkey.com/wiki/index.p ... on_objects. If you click on the ? button in the bottom left corner of the RegExp dialog box, you would get a list with some custom functions. There is also a shortened list of custom variables/properties which are using instead of MM fields, e.g. oSongData.AlbumName instead of <Album>, oSongData.TrackOrderStr instead of <Track#> and so on. However, you don't need to learn all those custom properties because you could get corresponding property if you click on the << button that is next to the Replace with edit box after you choose wanted field from the dropdown list at the right side of that button. For example, if you select Album from that list and click on the << button, you would get oSongData.AlbumName in the Replace with edit box. Of course, you first need to turn on the VBScript expression check box.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
BrynAilyn
Posts: 5
Joined: Wed Feb 28, 2007 5:27 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM

Post by BrynAilyn »

"If you click on the ? button in the bottom left corner of the RegExp dialog box, you would get a list with some custom functions. There is also a shortened list of custom variables/properties which are using instead of MM fields, e.g. oSongData.AlbumName instead of <Album>, oSongData.TrackOrderStr instead of <Track#> and so on. However, you don't need to learn all those custom properties because you could get corresponding property if you click on the << button that is next to the Replace with edit box after you choose wanted field from the dropdown list at the right side of that button. For example, if you select Album from that list and click on the << button, you would get oSongData.AlbumName in the Replace with edit box. Of course, you first need to turn on the VBScript expression check box."

Your answer and links were perfect and extremely helpful. The information in the quote was a real Rosetta Stone. Now I think I have what I need to customize some replacements that I want to do. Thanks.
-SuperFunk-
Posts: 45
Joined: Tue Aug 05, 2008 4:16 pm

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM

Post by -SuperFunk- »

After a few months, i'm coming back to a problem I posted here.
(see http://www.mediamonkey.com/forum/viewto ... 66#p250366 for my problem)

For this specific situation somebody helped me out:
I wanted to give alternative names to a "weak" tag (eg. if I have following tags: "Fusion, World Fusion & Celtic Fusion", I call 'Fusion' weak because I can't filter the songs with only 'fusion' as a tag)
The code for giving alternative names can be found in this post: http://www.mediamonkey.com/forum/viewto ... 80#p250456

Code: Select all

    Find what: (^|; )"here comes the style"
    RegExp1: checked
    Replace with: $1"here comes the alternative"
What I did is adding "[ALT]" directly to the weak tag using this script:
"Fusion" would become "Fusion[ALT]", Which is fine within my library organisation (I Am able to create auto-playlists the correct way)

Now I've tested this solution for other weak tags in my library:
Other Weak tags:

Fusion: World Fusion, Celtic Fusion
Big Band: Modern Big Band, Latin Big Band, Experimental Big Band
Swing: Retro Swing, New Jack Swing
Bop: Hard Bop, Post-Bop
Soul: Latin Soul, Philly Soul, Blue-Eyed Soul, Country Soul, Northern Soul, Pop-Soul, Retro-Soul, Uptown Soul, Southern Soul, Deep Soul, Memphis Soul, Chicago Soul, Smooth Soul, Brown-Eyed Soul, Neo-Soul, Psychedelic Soul, Soul-Blues, Soul Jazz,
Disco: Post-Disco
Freestyle: Latin Freestyle
Folk-Rock: British Folk-Rock
House: Acid House, Tribal House, Progressive House, Tech-House, Left-Field House, Microhouse, Merenhouse
Urban: Urban Blues
Deep Funk: Deep Funk Revival

... ETC
My problem is that the previous given solution doesn't work on all these tags,
for the underlined tags in the example above the solution won't work because the weak tag is also at the beginning of a 'stronger' tag.

Is there a code for The RegExp Find & Replace script to resolve this problem?
(I'm looking for an 'all-in one'-solution where I only have to care about the name of the weak tag and the alternative name I want to give for it)
Post Reply