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

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 »

-SuperFunk- wrote:Is there a code for The RegExp Find & Replace script to resolve this problem?
Well, I already said to you that I would never change my tags just because of some program's bug and suggested you to use Magic Nodes which doesn't have such problem, but if you really insist on your solution:
Find what: (^|; )"here comes the style"(?=;|$)
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
-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- »

ZvezdanD wrote:
-SuperFunk- wrote:Is there a code for The RegExp Find & Replace script to resolve this problem?
Well, I already said to you that I would never change my tags just because of some program's bug and suggested you to use Magic Nodes which doesn't have such problem, but if you really insist on your solution:
Find what: (^|; )"here comes the style"(?=;|$)
jep, I remember you saying that :)
I understand your concern about changing the tags but I just don't have the time to learn all about Magic Nodes and I don't want to bother people too much with questions about it.

I appreciate your help :wink:
Lowlander
Posts: 58575
Joined: Sat Sep 06, 2003 5:53 pm

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

Post by Lowlander »

RegExp Find & Replace seems to be able to add the same value more than once in multiple-value tags, as reported here: http://mediamonkey.com/forum/viewtopic.php?f=7&t=52344
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 »

Lowlander wrote:RegExp Find & Replace seems to be able to add the same value more than once in multiple-value tags, as reported here: http://mediamonkey.com/forum/viewtopic.php?f=7&t=52344
This is most probably some old version of this add-on with the preset "Add ""Art Rock"" as the last item to the multi-valued Genre field". With the latest version of the add-on there are updated presets for adding string to multi-item field which don't have mentioned problem: "Add specified string as first item to multi-item <Into Field>..." and "Add specified string as last item to multi-item <Into Field>..." presets.

I said several times in this thread and I will repeat - when I release some new version of this add-on, especially if there is updated syntax of presets, I strongly recommend the following steps:
1. make a backup of your own created presets;
2. uninstall old version of add-on and choose Yes when you asked if you want to remove add-on settings;
3. install new version of add-on;
4. import your own created presets.

In that way you would always have the latest and updated presets. If you don't remove old settings (together with presets), during the installation this script would check the preset's names and if they are same as old ones it would skip their installation, even if they are updated.
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
beg
Posts: 193
Joined: Wed Feb 04, 2009 12:36 pm

help for regular expression

Post by beg »

Hello,

maybe somebody can help me with the following problem:

some titles have this structure: Singer X-Title X
in artist there is: Artist X

And I'd like to tranform this into:

title: Title X
artist: Artist X con Singer X

so the part before the "-" in title has to added to the Artist with a preceding "con"
and for the title everything before "-" and the "-" itslef has to be removed.

Would be very thanfull if sby can provide solution for this?!

thx,
Bernhard
Haaden

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

Post by Haaden »

I have thousands of songs with bit rate information appended to the end of the title. I want to remove the bit rate information. What do I put in the "Find what" box?

Example: "Give Thanks.320kbps" to become "Give Thanks"

The "." and "kbps" are the same in all files, but the number could be anything from 10 to 9999.

I've tried everything I can think of and searched around to try and figure it out, but I'm a newbie and just can't get it.
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 »

Haaden wrote:I want to remove the bit rate information. What do I put in the "Find what" box?
Find what: \.\d+kbps$
RegExp 1: 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
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: help for regular expression

Post by ZvezdanD »

beg wrote:some titles have this structure: Singer X-Title X
in artist there is: Artist X

And I'd like to tranform this into:

title: Title X
artist: Artist X con Singer X

so the part before the "-" in title has to added to the Artist with a preceding "con"
Find what: $
Into: Artist
RegExp 1: checked
Replace with: IIf(InStr(oSongData.Title, "-") > 0, " con " & RTrim(Left(oSongData.Title, InStr(oSongData.Title, "-"))), "$&")
VBScript: checked
beg wrote:and for the title everything before "-" and the "-" itslef has to be removed.
"Remove the begin of <Into Field> before (and including) "-" or " - "..." 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
Haaden

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

Post by Haaden »

ZvezdanD wrote:
Haaden wrote:I want to remove the bit rate information. What do I put in the "Find what" box?
Find what: \.\d+kbps$
RegExp 1: checked
Thanks ZvezdanD, works perfectly! :D
Flytrap

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

Post by Flytrap »

I am having difficulty with the preset called "Swap first and last name of <Into Field> with added ", "...". In the example it says, "John Lee Hooker -> Hooker, John Lee (works with multi-item fields as well)," but my results look like "Lee Hooker, John."

One example string I am going to convert is "Jimmy Page; John Paul Jones; John Bonham." Everything works except John Paul Jones becomes "Paul Jones, John" so the output string is "Page, Jimmy; Paul Jones, John; Bonham, Jones." This happens on strings with one artist as well. Example: Stevie Ray Vaughan becomes Ray Vaughan, Stevie. If it matters, this is the Composer field.

The preset RegExp looks like this:
Find what: (.+?)(\s+)(.+?)($|\s&\s|;\s*)
Replace with: $3,$2$1$4

I am using v. 4.0.3.

Thank you!
Flytrap

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

Post by Flytrap »

Flytrap wrote:Everything works except John Paul Jones becomes "Paul Jones, John" so the output string is "Page, Jimmy; Paul Jones, John; Bonham, Jones." !
Sorry, this should read: ...output string is "Page, Jimmy; Paul Jones, John; Bonham, John."
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 »

Flytrap wrote:I am having difficulty with the preset called "Swap first and last name of <Into Field> with added ", "...". In the example it says, "John Lee Hooker -> Hooker, John Lee (works with multi-item fields as well)," but my results look like "Lee Hooker, John."
Thanks for the report, the fix will be included with the next version of this add-on. Here is the updated Find what string:

Code: Select all

(.+?)(\s+)([^\s]+?)($|\s&\s|;\s*)
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
beg
Posts: 193
Joined: Wed Feb 04, 2009 12:36 pm

Re: help for regular expression

Post by beg »

ZvezdanD wrote:
beg wrote:some titles have this structure: Singer X-Title X
in artist there is: Artist X

And I'd like to tranform this into:

title: Title X
artist: Artist X con Singer X

so the part before the "-" in title has to added to the Artist with a preceding "con"
Find what: $
Into: Artist
RegExp 1: checked
Replace with: IIf(InStr(oSongData.Title, "-") > 0, " con " & RTrim(Left(oSongData.Title, InStr(oSongData.Title, "-"))), "$&")
VBScript: checked
beg wrote:and for the title everything before "-" and the "-" itslef has to be removed.
"Remove the begin of <Into Field> before (and including) "-" or " - "..." preset
thx for that code! But is there the possiblity to add the "con Singer X" not to the end of the title what this is doing as far as I understand, but to the artist?! So it has to be cut from the title, but added to the end of the artist.

thx,
Bernhard
Guest

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

Post by Guest »

Hello ZvezdanD, do you have a news letter about updates?
I looking forward to the batch function
ZvezdanD
Posts: 3265
Joined: Thu Jun 08, 2006 7:40 pm

Re: help for regular expression

Post by ZvezdanD »

beg wrote:
ZvezdanD wrote:Find what: $
Into: Artist
RegExp 1: checked
Replace with: IIf(InStr(oSongData.Title, "-") > 0, " con " & RTrim(Left(oSongData.Title, InStr(oSongData.Title, "-"))), "$&")
VBScript: checked
thx for that code! But is there the possiblity to add the "con Singer X" not to the end of the title what this is doing as far as I understand, but to the artist?! So it has to be cut from the title, but added to the end of the artist.
Have you modified the Into field as I suggested?
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
Post Reply