Page 70 of 109
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sat Aug 22, 2015 1:48 pm
by Vexa
Hello everyone. I have done some searching and found that someone had requested this before but I never saw any responses to it. I struggled my way through a few online RegEx courses but am still a bit lost as my expressions are not working in a flash based checker.
I am trying to create an expression to match songs with the producer listed at the end of the song title and to move it to Composer. I looked for an actual Producer metadata slot but couldn't find one so I was just going to use that.
And.. I'm completely lost.
It doesn't matter what it starts with so I can do a '.+' to start with right? And then I just need to match the '((|[)Prod.+' piece right? Because it can either be '(' or '[', and it can say 'Producer' or 'Prod' or 'Prod.'
But then I need to capture the text after 'By ' and move it to the Composer portion of the metadata and then delete the whole piece of it from the song title..
And that's the part where I am totally and completely lost. I don't even know where to start with that portion so I'm not sure what to even look up. All I know is to use brackets () for capture groups after matching the 'By ' string but.. yeah.
Can anyone help me create something to perform this function or even quickly write one up for me? I'd prefer if someone could walk me through it as RegEx are pretty interesting but again, I am in totally over my head.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sat Aug 22, 2015 2:17 pm
by MMFrLife
Vexa wrote:I am trying to create an expression to match songs with the producer listed at the end of the song title and to move it to Composer.
You want to copy the producer from the end of your song titles (because it's already there) and move or copy them into composer?
Or, you want to copy producer to both the end of the song title and the composer?
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sat Aug 22, 2015 2:23 pm
by Vexa
Here I will provide some examples.
In my library I currently have:
1. Halo (Letter From My Unborn Son) (Feat. Heaven & Harmony) [Prod. By Street Symphony & 808xElite]
2. Hustle Hard (Prod. by Lex Luger)
3. Get Back Up Ft. Chris Brown (Produced By The Neptunes)
And I want the titles to be
1. Halo (Letter From My Unborn Son) (Feat. Heaven & Harmony)
2. Hustle Hard
3. Get Back Up Ft. Chris Brown
With the Producer data put into the Composer metadata position. Does that make a bit more sense? There are parentheses and brackets, some say producer and some say prod, with or without a period, and some have 'by' vs 'By'.
EDIT : A spin on a similar action would be to take the Featuring Feat. or Feat (Artist) and move that from the Artist metadata and suffix it to the song title. However I believe this function is already a preset in the plugin (?). I just was made aware of this add-on today so still learning a lot.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sat Aug 22, 2015 2:57 pm
by MMFrLife
First off, there is a Producer column. It's just under the Director in the "Into" drop down menu.
I don't think this can be accomplished with a single pre-existing preset. Maybe with a combination.
For a single maneuver, you'd need something like remove a certain number of words (1) from the end of the "From" field but copy (via move) it
to the Into field or vice versa. Removing first as a separate step would be disastrous.
The feat. artist example is problematic because in this case the string for the producer isn't uniform.
I would be interested in seeing a response to this myself. I wouldn't know how to create a new preset for it.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sun Aug 23, 2015 8:00 am
by Haaden2
ZvezdanD wrote:Haaden2 wrote:Getting "Expression Error!" using Preset 155 Remove duplicate items in multi-item <Into Field>....
I cannot try it right now, so let me know if this works:
Code: Select all
Preset155=Name: "Remove duplicate items in multi-item <Into Field>...", Description: "Rock; Prog-Rock; Rock; Art Rock -> Rock; Prog-Rock; Art Rock", Shortcut: "", Icon: "", Toolbar: 0, FindWhat: "^.*", FindInto: "Genre", FindRegExp: 1, WholeWord: 0, ReplaceWith: "Execute(""Dim aItems, bMatch, sField, iItem, jItem: aItems = Split(Replace(sBefore, """"; """", """";""""), """";""""): For iItem = 0 To UBound(aItems): bMatch = False: For jItem = 0 To iItem - 1: If aItems(jItem) = aItems(iItem) Then bMatch = True: Exit For: End If: Next: If Not bMatch Then sField = sField & aItems(iItem) & """"; """": End If: Next: If Len(sField) Then sField = Left(sField, Len(sField) - 2) End If: SetVar 0, sField"") & GetVar(0)", ReplaceFrom: "Title", ReplaceRegExp: 0, ReplaceVBScr: 1, MatchCase: 0
Unfortunately this doesn't work - it wipes the field clean regardless of duplicate or not. May I ask for further assistance? I have been trying to solve this myself but have only succeeded in getting completely confused and frustrated.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sun Aug 23, 2015 8:27 am
by ZvezdanD
Haaden2 wrote:Unfortunately this doesn't work - it wipes the field clean regardless of duplicate or not.
There is a new release of the add-on with that preset fixed.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sun Aug 23, 2015 10:51 am
by ZvezdanD
Preset: Assign [(prefix string)] from <From Field> to <Into Field>...
Description: If specified prefix is "feat.", Something [feat. Artist1, Artist2] or Something (feat. Artist1, Artist2) (From Field) -> Artist1, Artist2 (Into Field)
Find what: ^.*
Regular expression 1: checked
Replace with: RegExpEx(<From Field>, "([([](?:<String Caption="Prefix text (RegEx)" Value="ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents">)\s+)([^\]\)]+)", 0, 1)
VBScript expression: checked
Preset: Remove [(prefix string]) from <Into Field>...
Description: If specified prefix is "feat.", Something [feat. Artist1, Artist2] or Something (feat. Artist1, Artist2) -> Something
Find what: ^.*
Regular expression 1: checked
Replace with: RegSub("$&", "\s+[([](?:<String Caption="Prefix text (RegEx)" Value="ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents">)\s[^\])]+?[\])]", "")
VBScript expression: checked
The prefix text could be any regular expression, e.g. "Prod(?:uced|\.)? By" instead of "ft\.?|feat\.?|featuring|vs\.?|versus|pres\.?|presents". By the way, all existing predefined presets for featuring artists have that regular expression, i.e. they cover almost all kind of feat. type (ft with or without dot, feat with or without dot and so on) and of course that string is not uniform.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sun Aug 23, 2015 12:26 pm
by Haaden2
ZvezdanD wrote:There is a new release of the add-on with that preset fixed.
Not Found
The requested URL /~zvezdand/RegExpReplace-4.4.0.1.mmip was not found on this server.
I really don't mean to be a pain in the ass. You have great add-ons and support them very well!
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sun Aug 23, 2015 12:32 pm
by ZvezdanD
Haaden2 wrote:Not Found
The requested URL /~zvezdand/RegExpReplace-4.4.0.1.mmip was not found on this server.
It is 4.4.0.2 now. Did you try to refresh its Web page?
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Sun Aug 23, 2015 1:25 pm
by Haaden2
ZvezdanD wrote:It is 4.4.0.2 now. Did you try to refresh its Web page?
OK, got it now. Preset appears to be working perfectly. Went to your download page and gladly made a donation for this great add-on and your great support of it. Thank you very much!
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Tue Aug 25, 2015 2:18 am
by NWDreamer
Ok, I've got a weird (and annoying) one... I've been using the "Auto-increment Track number with specified starting value" preset for awhile and it's worked fine (but always with a starting value of 1). I had one large album where the first two songs were fine so I selected the rest and set the starting value to 3. Instead of changing the track number field, it put the track number into the Title field instead, obviously wiping out all the titles... A couple more tries and it still didn't work so I fixed that album manually and didn't think about it until now when I went to add track numbers to an entire album so I set the starting value back to 1 and, again, it put all the track numbers into the Title field; wiping out the titles that were there...
Now it doesn't seem to want to work correctly no matter what I do and I'm REALLY tired of having to re-enter song titles! Any idea what caused this and how I can fix it? I was using that preset quite a bit prior to this.
Thanks,
Craig
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Tue Aug 25, 2015 3:08 am
by ZvezdanD
NWDreamer wrote:Any idea what caused this and how I can fix it?
Most probably you have modified that preset changing
Into field from Track # to Title. If you haven't, please post the screenshot of the RegExp Find & Replace dialog box with the mentioned preset selected.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Wed Aug 26, 2015 12:51 am
by NWDreamer
Your comment had me dig into things a bit (since I just started using your addon, I had forgotten to look at the preset options and code). I found that the Auto-Increment preset was now looking at the Title field (as expected) instead of the Track # field for both input & output. I changed these back to Track # and confirmed that the preset worked again. Going farther, here's what I've found out: Changing the starting number alters the preset to use the Title field for both input and output (i.e., without my doing anything other than changing the starting number in the dialog). Below are five screenshots with notations that show this behavior. The first three show a corrected preset and, also, correct operation when using a starting number of 1. The last two show what happens when you change the starting number to 3. Since the screenshots are large, I'm only including links.
http://www.nwdreamer.com/pics/MediaMonk ... reen-1.jpg
http://www.nwdreamer.com/pics/MediaMonk ... reen-2.jpg
http://www.nwdreamer.com/pics/MediaMonk ... reen-3.jpg
http://www.nwdreamer.com/pics/MediaMonk ... reen-4.jpg
http://www.nwdreamer.com/pics/MediaMonk ... reen-5.jpg
In Extensions it says I'm using v4.4.0.1 of your script. I'm also using MM v4.1.8.1751 Portable Mode. If you don't get the same results, let me know what you'd like me to check or try.
Craig
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Wed Aug 26, 2015 5:24 am
by ZvezdanD
NWDreamer wrote:In Extensions it says I'm using v4.4.0.1 of your script.
I have fixed the mentioned problem in v4.4.1. Thank you for the report.
Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M
Posted: Wed Aug 26, 2015 6:46 am
by NWDreamer
Great! Nice to see any addon author being as on top of things too!
