Hi,
I'm new here and first i want to say thanks to the developer for this great program and the forum members for the awesome support.
Now here is my problem:
Over the years I have stored two species of URLs among others in the %www% field of my mp3 collection.
For Example it looks like:
http://www.mute.com/ http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:0cfqxq80ldde http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:3ifoxzysldde http://coverparadise.to/index.php?Module=ViewEntry&ID=7735 http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:gcfqxq9jld0e http://coverparadise.to/index.php?Module=ViewEntry&ID=69885 http://www.emimusic.de
My goal is to extract all IDs from the URLs to user defined fields with multiple values like
Field: ALLMUSICID
Value: 0cfqxq80ldde\\\\3ifoxzysldde\\\\gcfqxq9jld0e
Field: COVERPARADISEID
Value: 7735\\\\69885
My first try to solve this problem was the following regular expressions combined with functions:
$replace($trim($regexp($regexp(%www%,'http://www\.allmusic\.com/cg/amg\.dll\?p=amg&sql=10:\w+\s?',),'http://coverparadise\.to/index\.php\?Module=ViewEntry&ID=',)), ,\\\\)
This is for the field COVERPARADISEID. It removes first all instances of the allmusic URL including ID. Then it deletes all instances of the coverparadise URL not including ID. After that it trims space and finally all spaces were replaced by \\.
For the field ALLMUSICID analog:
$replace($trim($regexp($regexp(%www%,'http://coverparadise\.to/index\.php\?Module=ViewEntry&ID=\d+\s?',),'http://www\.allmusic\.com/cg/amg\.dll\?p=amg&sql=10:',)), ,\\\\)
The disadvantage of this method is that this only works corrctly if only allmusic and coverparadise urls are stored in the %www% field. In the case of the existence of another type of urls these were added to the user definded fields:
Field: ALLMUSICID
Value: http://www.mute.com/\\\\0cfqxq80ldde\\\\3ifoxzysldde\\\\gcfqxq9jld0e\\\\http://www.emimusic.de
Field: COVERPARADISEID
Value: http://www.mute.com/\\\\7735\\\\69885\\\\http://www.emimusic.de
A better sollution would be a expression that matches every instance of a species of urls regardless of their position and returns the IDs separated by space or \\. So I tried again and found this one for the allmusic field:
$regexp(%www%,'((http://www\.allmusic\.com/cg/amg\.dll\?p=amg&sql=10:)(\w+)\s?)+\s?.*','$3')
This expression matches only the ID of the first instance of the adress and leaves the following ones unconsidered.
Field: ALLMUSICID
Value: 0cfqxq80ldde
If someone could help me to figure out how to modify the expression that it matches all IDs from allmusic (or coverparadise) would be great.
Kind regards
Knabbakeks