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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Post by ZvezdanD » Tue Jun 10, 2008 10:59 am

Muther wrote:I have no idea what to search for to replace double spacing between lyrics lines? So I thought I would ask for a hint, i didn't see anything in the presets, I'm thinking it may be /n or \n or maybe /nl but before I ruin all my lyrics I thought I'd ask someone in the know
Well, chances that you would ruin your lyrics are relatively small. This script has info fields where you could see effect of some replacement, and has table where you could see same replacement for all selected/visible tracks, before you actually decide to press Replace or Replace All buttons.

There is no such thing as /n or /nl with Regular expressions. VBScript implementation of the RegExp supports \n for the line feed and \r for the carriage return. I am not so sure if I know what you want, but I think that it is very similar to the preset "Remove multiple spaces from the Title". You should enter next settings, but previously you need to download the new version of the script. Your question helped me to discover one bug. Thanks :)

Find what: (\r\n){2,}
Regular expression 1: checked
Replace with: $1
Regular expression 2 and VBScript expression: unchecked

By doing this you would have not space between paragraphs. Maybe you should remove space between lines only if there is more than 2 spaces. So, I think you should better try:
Find what: (\r\n){3,}
Replace with: $1$1

Muther
Posts: 27
Joined: Thu Jun 05, 2008 3:47 pm

Post by Muther » Tue Jun 10, 2008 5:31 pm

Ok Thanks for the info, I'll give it a shot and let you know how it goes.

Muther
Posts: 27
Joined: Thu Jun 05, 2008 3:47 pm

Post by Muther » Wed Jun 11, 2008 12:24 am

Well I tried but had no luck, I tried to take a crash course online in RegExp but just ended up confusing my self more...LOL

I've looked for other programs and tag editors for this feature and can find none that will handle it.

it would be nice also to remove "all CAPS" and just cap the first letter of each line< I'm currently going through my 12,000 collection one by one to fix all this. I should be done in a little less than a month....:)

Thanks for tring to help me though.

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

Post by ZvezdanD » Wed Jun 11, 2008 12:01 pm

Muther wrote:Well I tried but had no luck, I tried to take a crash course online in RegExp but just ended up confusing my self more...
Well, I tried example before posted it and it works correctly. Did you entered all settings as I mentioned? What is displayed in your Result field and in New Lyrics column of the table?

I just noticed that mentioned strings have one undesired space character on the end of string. If you copy/paste those strings, you should know that Find what should be "(\r\n){2,}", but not "(\r\n){2,} ".
it would be nice also to remove "all CAPS" and just cap the first letter of each line<
This is similar to the preset "Uppercase the first letter of sentence or each folder/filename of the Path". You could try next settings, but before that you should download the new release of this script (2.1.2) which has removed a bug with new lines (again):

Find what:

Code: Select all

([\w\xDF-\xF6\xF8-\xFF\u0100-\u024F\u0400-\u04FF])([^\r\n]*)
Into: Lyrics
Regular expression 1: checked
Replace with:

Code: Select all

UCase("$1") & LCase("$2")
VBScript expression: checked

Muther
Posts: 27
Joined: Thu Jun 05, 2008 3:47 pm

Post by Muther » Wed Jun 11, 2008 1:02 pm

Ok it works now (\r\n){2,} finds and strips out all blank lines not really what I wanted to do so I'll do it by hand. I cant figure out a way to get rid of some and keep the ones between the phrases. I cant even do it if it was delete every other line because thats not always how it is.

the second expression (\r\n){3,} only strips out double blank lines. which is useful and I can use it but still need to go in and fix the double line spaces

The case fix worked great! thank you!

Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny » Wed Jun 11, 2008 1:08 pm

im trying to do this (http://www.mediamonkey.com/forum/viewto ... 231#154231)

but im not sure if im doing it right or if its even possible with this script can anyone help me with the syntax?
Image
Image

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

Post by ZvezdanD » Wed Jun 11, 2008 1:09 pm

Muther wrote:the second expression (\r\n){3,} only strips out double blank lines. which is useful and I can use it but still need to go in and fix the double line spaces
Sorry, but I could not read your mind. I already said that I don't know what you want and you didn't explained me more specific what is your intention. Send me one wrong lyrics with extra spaces and same lyrics which you cleaned by hand, so I could see what you want.

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

Post by ZvezdanD » Wed Jun 11, 2008 1:57 pm

Diabolic-Destiny wrote:im not sure if im doing it right or if its even possible with this script can anyone help me with the syntax?
Yes, this is possible with this script, but with several steps. You could take a look on the presets "Add featuring artists from the Artist field to the list of Involved people".

First example:

Code: Select all

[Title Tag]                              [Artist Tag]               [Album Artist]
Title ft. Artist, Artist, Artist             Artist                       Artist
I want to make so that it looks like this

Code: Select all

[Title Tag]                             [Artist Tag]               [Album Artist]
Title                              Artist [Ft. Artist, Artist]       Artist
1. step (copy featuring artists from the Title to the Artist field):
Find what:

Code: Select all

^.*
Into: Artist
Regular expression 1: checked
Replace with:

Code: Select all

"$&" & IIf(Len(RegExp(oSongData.ArtistName, ".+(?:feat. |featuring |vs. |pres. |presents ).+", 0)) > 0, " [" & RegSub(oSongData.ArtistName, "(.+)((?:feat. |featuring |vs. |pres. |presents ).+)", "$2") & "]", "")
VBScript expression: checked

2. step (remove featuring artists from the Title):
Find what:

Code: Select all

(.+)(\s(?:feat. |featuring |vs. |pres. |presents ).+)
Into: Title
Regular expression 1: checked
Replace with:

Code: Select all

$1
Regular expression 2 and VBScript expression: unchecked

Third example:

Code: Select all

[Title Tag]                                     [Artist Tag]        [Album Artist]
Title (remix)                                      Artist                Artist
to

Code: Select all

[Title Tag]                                [Artist Tag]             [Album Artist]
Title [Remix]                                   Artist                   Artist
Third example is simple:
Find what: (remix)
Into: Title
Regular expression 1: unchecked
Replace with: [Remix]
Regular expression 2 and VBScript expression: unchecked

Your second example is just combination of the first and third example.

Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny » Wed Jun 11, 2008 2:14 pm

Thanks ZvezdanD, I managed to get Step 2 to work however step 1 still isn't copying the Featured Artists from the title to the Artist Field

Image
Image
Image

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

Post by ZvezdanD » Wed Jun 11, 2008 2:22 pm

Diabolic-Destiny wrote:step 1 still isn't copying the Featured Artists from the title to the Artist Field
Oh, sorry. I copied/pasted string from the preset "Add featuring artists from the Artist field to the list of Involved people" and forgot to change the field from Artist to Title. Here is a new Replace with string for the step 1:

Code: Select all

"$&" & IIf(Len(RegExp(oSongData.Title, ".+(?:feat. |featuring |vs. |pres. |presents ).+", 0)) > 0, " [" & RegSub(oSongData.Title, "(.+)((?:feat. |featuring |vs. |pres. |presents ).+)", "$2") & "]", "")
However, you should first do first step, than second, or you would get lost featuring artists.

Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny » Wed Jun 11, 2008 2:32 pm

awsome that worked great but a minor thing

the artist becomes [feat. XXXXX] how can i make it [Ft. XXXX] lol sorry for being picky

this is an awesome script im definitely going to play around with it
Image
Image

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

Post by ZvezdanD » Wed Jun 11, 2008 2:36 pm

Diabolic-Destiny wrote:the artist becomes [feat. XXXXX] how can i make it [Ft. XXXX]
Well, this is really simple, similar as with MS Word:
Find what: [feat.
Replace with: [Ft.
All checkboxes unchecked.

Or, if you want somewhat more general approach, you could check Regular expression 1 and type the next Find what:

Code: Select all

\[(feat.|featuring|ft.)\s
Last edited by ZvezdanD on Wed Jun 11, 2008 2:42 pm, edited 1 time in total.

Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny » Wed Jun 11, 2008 2:38 pm

ZvezdanD wrote:
Diabolic-Destiny wrote:the artist becomes [feat. XXXXX] how can i make it [Ft. XXXX]
Well pal, this is really simple, similar as with MS Word:
Find what: [feat.
Replace with: [Ft.
All checkboxes unchecked.
oh I wasn't thinking of making a new script what i mean was, incorporate that into the first step, but my guess is its not possible, because i was trying to meddle with it but didn't seem to work
Image
Image

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

Post by ZvezdanD » Wed Jun 11, 2008 2:51 pm

Diabolic-Destiny wrote:oh I wasn't thinking of making a new script what i mean was, incorporate that into the first step
Well, this is not a whole new script, just new preset. :) It could be useful if you keep them separated. But anyway, here is a Replace with string for the first step if you like this approach:

Code: Select all

"$&" & IIf(Len(RegExp(oSongData.Title, ".+(?:feat.|featuring|ft.)\s.+", 0)) > 0, " [Ft. " & RegSub(oSongData.Title, "(.+(?:feat.|featuring|ft.)\s)(.+)", "$2") & "]", "")
also when i put the

(remix) it doesn't highlight it, however if i do remix or (remix it does highlight it while keeping the ) or both ( ) if the first one was used
Sorry, I don't understand this. Could you be more specific?

Diabolic-Destiny
Posts: 223
Joined: Sun Apr 29, 2007 9:45 pm

Post by Diabolic-Destiny » Wed Jun 11, 2008 4:31 pm

thanks that worked, just ignore the remix thing i figured it out

Thanks man great script!!
Image
Image

Post Reply