RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Hi:
I need a little help again. I would like to setup a preset that would search the lyrics field for any non-English alphabet characters, is this possible? I don't need to replace them, I just want to identify them in order to replace the lyrics with a different script.
Nyn
I need a little help again. I would like to setup a preset that would search the lyrics field for any non-English alphabet characters, is this possible? I don't need to replace them, I just want to identify them in order to replace the lyrics with a different script.
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Of course it is possible. For example you could take a look on the "Capitalize the Title (ASCII, Latin 1, Latin 2 & Cyrillic)" preset which contains character ranges.nynaevelan wrote:I would like to setup a preset that would search the lyrics field for any non-English alphabet characters, is this possible?
If you want to find a field which contain English alphabet characters, you should write the next string for the Find what:
Code: Select all
[A-Za-z]
Code: Select all
[^A-Za-z]
Code: Select all
[\xDF-\xF6\xF8-\xFF\u0100-\u024F\u0400-\u04FF]
I don't know exactly what you want, but I think that even this could be done automatically with this script.nynaevelan wrote:I don't need to replace them, I just want to identify them in order to replace the lyrics with a different script.
● 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
-
- Posts: 5559
- Joined: Wed Feb 07, 2007 11:07 pm
- Location: New Jersey, USA
- Contact:
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Will you examples catch Chinese characters also?
Nyn
Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Link to Favorite Scripts/Skins
Join Dropbox, the online site to share your files
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
No, it will match only Latin 1, Latin 2 and Cyrillic. If you are interested about character ranges, please take a look on http://www.unicode.org/Public/UNIDATA/Blocks.txt or http://www.regular-expressions.info/unicode.html.nynaevelan wrote:Will you examples catch Chinese characters also?
Anyway, if you want to find all non-ASCII characters, you could try with:
Code: Select all
[^\x20-\x7F]
Code: Select all
[^\u0020-\u007F]
● 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
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
I need a little help, I am trying to remove the timing marks from LRC lyrics
From this
[00:13]E già
[00:15]Io sto sempre con gli altri
[00:19]Però
and get this
E già
Io sto sempre con gli altri
Però
In Find What I put [:\d] using regular expression 1 and that gives me
[]E già
[]Io sto sempre con gli altri
[]Però
Is there any way of removing all, those brackets are killing me, I will never get to sleep tonight.
Any help would be much appreciated
Cheers from down here.
EDIT
Never mind... I got it. Had to use
[][:\d]
I Love This Script
From this
[00:13]E già
[00:15]Io sto sempre con gli altri
[00:19]Però
and get this
E già
Io sto sempre con gli altri
Però
In Find What I put [:\d] using regular expression 1 and that gives me
[]E già
[]Io sto sempre con gli altri
[]Però
Is there any way of removing all, those brackets are killing me, I will never get to sleep tonight.
Any help would be much appreciated
Cheers from down here.
EDIT
Never mind... I got it. Had to use
[][:\d]
I Love This Script
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Glad you found your way to do this. However, I think this is not the best approach for such thing because it would remove all occurrences of specified characters, even if they are not a part of timing marks - "[", "]", ":" and digits from "0" till "9". This is because square brackets are reserved characters in RegExp and they are used for specifying character classes. If you want to specify square brackets as plain characters you should put backslash in the front of them - \[ and \].barkoz wrote:Never mind... I got it.
There are several more appropriate solutions to your request, here is the simplest one:
Code: Select all
\[\d\d:\d\d\]
Code: Select all
(^|\r\n)(\[\d\d:\d\d\])
● 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
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Hello,
Is it possible to replace more words on the same line at once?
I want to do the following thing:
Find one of these words: ft,feat,vs, Versus
and replace it with: ;
Is it possible to replace more words on the same line at once?
I want to do the following thing:
Find one of these words: ft,feat,vs, Versus
and replace it with: ;
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Yes, it is.djo4ever wrote:Is it possible to replace more words on the same line at once?
Did you tried the suggestion described at http://www.mediamonkey.com/forum/viewto ... 20#p163520?djo4ever wrote:Find one of these words: ft,feat,vs, Versus
and replace it with: ;
● 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
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Thank's mate,I hadn't realised that, is there anything this script can't do besides the dishes?ZvezdanD wrote
Glad you found your way to do this. However, I think this is not the best approach for such thing because it would remove all occurrences of specified characters, even if they are not a part of timing marks - "[", "]", ":" and digits from "0" till "9". This is because square brackets are reserved characters in RegExp and they are used for specifying character classes. If you want to specify square brackets as plain characters you should put backslash in the front of them - \[ and \].
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
I'm almost sure it can't do the laundry too... but who knowsbarkoz wrote:Thank's mate,I hadn't realised that, is there anything this script can't do besides the dishes?
-
- Posts: 251
- Joined: Tue Dec 06, 2005 8:01 pm
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Wow this script is powerful! Many thanks!
I have mainly been using it to work on lyrics and noticed a small nit-pick:
The preset "Uppercase the first letter of each line of the Lyrics" is not ideal.
Currently, it uppercases the first character but sets everything else in lower case!
Anything that was capitalized before is now lower case, including for examples place
names and pronouns ("i am" vs "I am").
An easy fix is to change the replace with field:
should be replaced with
Of course, this assumes that the ONLY capitalization problem with the lyrics was the first letter of each line...
Another alternative I found is a simple preset to always capitalize the pronoun "I", as follows:
That got me thinking, would it be possible to make a preset that would replace all kinds of words with others?
Like "cos", "cuz" with "cause" (a pet peeve of mine), or add apostrophes where missing (im, ill, dont, wont -> I'm, I'll, don't, won't)
Your script uses an extremely powerful algorithm, I think it would be great to incorporate it into a dedicated
"lyrics cleanup script" with user-defined replacements. Combined with das Monkey's amazing "Lyricator" script,
it would make adding lyrics a breeze indeed!
I have mainly been using it to work on lyrics and noticed a small nit-pick:
The preset "Uppercase the first letter of each line of the Lyrics" is not ideal.
Currently, it uppercases the first character but sets everything else in lower case!
Anything that was capitalized before is now lower case, including for examples place
names and pronouns ("i am" vs "I am").
An easy fix is to change the replace with field:
Code: Select all
UCase("$1") & LCase("$2")
Code: Select all
UCase("$1") & "$2"
Another alternative I found is a simple preset to always capitalize the pronoun "I", as follows:
Code: Select all
Uppercase "i" in the Lyrics
Find what: \bi\b
Into: Lyrics
Replace with:I
Match case: checked
Like "cos", "cuz" with "cause" (a pet peeve of mine), or add apostrophes where missing (im, ill, dont, wont -> I'm, I'll, don't, won't)
Your script uses an extremely powerful algorithm, I think it would be great to incorporate it into a dedicated
"lyrics cleanup script" with user-defined replacements. Combined with das Monkey's amazing "Lyricator" script,
it would make adding lyrics a breeze indeed!
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Yes, I am aware about the English word "I" (http://www.mediamonkey.com/forum/viewto ... 44#p163244), and there is also a problem with personal names which should have first character uppercased.MCSmarties wrote:The preset "Uppercase the first letter of each line of the Lyrics" is not ideal.
Currently, it uppercases the first character but sets everything else in lower case!
Well, this is just one more problem for such implementation. What if someone has a lyrics with all characters in uppercase? How about languages where "I" should not be uppercased? Believe it or not, in my language the word "I" has a meaning of "and" in English and it should be lowercased when it is in sentence.MCSmarties wrote:Of course, this assumes that the ONLY capitalization problem with the lyrics was the first letter of each line...
Anyway, I am thinking to introduce one more preset for the next version of this script which would be same as mentioned preset, except it would uppercase the word "I" and maybe it would have a rather limited list of English personal names (of course, this list would be user-customizable).
Of course it is possible. There are already included some presets which are doing similar thing, even within only one step. Just take a look at the preset "Fix common words (featuring, presents, versus)" or "Remove diacritical marks from the Title" - with a single preset you could replace many characters or words to another characters or words: Feat, feat, Feat., feat., Featuring, featuring, Features, features, Ft, ft, Ft. are all converted to ft., then Presents, Presenting ... to pres. and Versus, Vs ... to vs.. It is all possible with a help of the custom VB function MapArray.MCSmarties wrote:would it be possible to make a preset that would replace all kinds of words with others?
Like "cos", "cuz" with "cause" (a pet peeve of mine), or add apostrophes where missing (im, ill, dont, wont -> I'm, I'll, don't, won't)
Here are settings for your example:
Find what:
Code: Select all
\b(?:(cos|cuz)|([Ii]m)|([Ii]ll)|(dont)|(wont))\b
Code: Select all
MapArray(Array("$1", "cause", "$2", "I'm", "$3", "I'll", "$4", "don't", "$5", "won't"))
● 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
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
I apologize if this question has been answered already but I was curious if there would be a way to use the 'fix featured' routine and modify it so that I could make the Title of the song have featured artist instead of the artist.. example:
From
------
Artist: 112 featuring Lil'z
Title: Anywhere
To
----
Artist: 112
Title: Anywhere (feat. Lil'z)
Any help would be great... you have a get product I am just really lame when it comes to coding
From
------
Artist: 112 featuring Lil'z
Title: Anywhere
To
----
Artist: 112
Title: Anywhere (feat. Lil'z)
Any help would be great... you have a get product I am just really lame when it comes to coding
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Have you tried a suggestion described at http://www.mediamonkey.com/forum/viewto ... 36#p154236?xabaras wrote:if there would be a way to use the 'fix featured' routine and modify it so that I could make the Title of the song have featured artist instead of the artist..
● 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
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Thanks for the script. Should have got it a while ago.
Cogito cogito ergo cogito sum. (Ambrose Bierce)
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies
I drink therefore I am. (Monty Python)
Vista 32bit Home Premium SP2 / MM3.2.1.1297 Gold / Last.Fm 1.0.2.22 / IE8
Dell Inspiron 530 (1.8 Core2 / 2GB)
Skin: Vitreous Blue
Scripts: Add/Remove Playstat|Advanced Duplicate Find & Fix|Album Art Tagger|Backup|Batch Art Finder|Calculate Cover Size|Case&Leading Zero Fixer|DB_Audit|DB_Clean|DB_Schema|Event Logger|Genre Finder|Lyricator|Magic Nodes|MM2VLC|Monkey Rok|MusicIP Tagger|PUID Generator|RegExp Find & Replace|Right Click for Scripts|Scriptreloader|SQL Viewer|Stats(Filtered)|Tagging Inconsistencies