[globset]: understanding a more complex glob (idea and reality) #2363
Replies: 2 comments 3 replies
-
It's honestly a bit difficult to parse what you actually want here. Namely, 1) you've written your boolean logic in ambiguous prose, 2) the glob you've provided doesn't make any sense to me and 3) there isn't a concrete expected output that you've provided. (2) is perhaps something worth digging into though. When trying to understand something, I recommend breaking it down into smaller parts and then trying to understand those smaller parts. So for example, why not look at Popping up a level, |
Beta Was this translation helpful? Give feedback.
-
Okay, I now tried that with multiple globset and also corrected my misunderstanding. TasK: Get all ending with "Rock", but leave out all that start with "Latin". I expect to have "Soft Rock", "Hard Rock", "Blues Rock", etc. Summed up:
Using "is_match()" shows everything ending with Rock but not starting with "Latin". Did I understand that correctly? |
Beta Was this translation helpful? Give feedback.
-
Hej there,
I am trying to run a glob for filtering out music genres. There is a list of all genres:
{"synthie pop", "musicbox", "melodic hardcore", "italian rock", "soundtrack", "vallenato", "latin pop", "house", "classical", "country", "other", "glam rock", "r&b", "wagnerian rock", "cumbia", "latin house", "fastnacht", "axé", "son cubano", "eurodance", "gospel", "latin urban", "reggae", "latin reggae", "alternative rock", "rap", "swing", "guajira", "europop", "indie", "metal", "folk", "country rock", "unterhaltungsmusik", "tumbao", "unknown", "latin celtic pop", "disco", "latin heavy metal", "italian pop", "blues rock", "instrumental rock", "mpb", "new wave", "bolero", "nu metal", "criolla", "freestyle", "sertanejo", "crossover", "afro-cuban jazz", "danzón", "soft rock", "musical", "volksmusik", "rap metal", "ska-punk", "jukebox", "flamenco", "reggae fusion", "euro house", "christmas", "punk pop", "andean folk", "reggaeton", "happy hardcore", "pagode", "chanson", "schlager", "world music", "progressive pop", "rock ’n’ roll", "religiöse musik", "euro reggae", "latin celtic rock", "singer-songwriter", "rumba flamenca", "folk pop", "roots rock", "electronic", "latin jazz", "nuevo canto", "chinese hip hop", "soul", "neue deutsche härte", "latin rock", "folk rock", "ballad", "vocal", "latin folk metal", "heavy metal", "nueva trova", "psychedelic rock", "break dance", "rock & roll", "hip hop", "merengue", "rave", "celtic rock", "instrumental", "blues", "metalcore", "deutsch-rap", "heartland rock", "power metal", "pop", "britpop", "ambient music", "latin ska", "austrian pop", "punk rock", "punk", "bachata", "funk", "glam metal", "hard rock", "alternative", "funk rock", "axe", "grunge", "trance", "progressive metal", "alternative metal", "folk metal", "liedermacher", "skiffle", "contemporary folk", "pbm", "jazz", "singer", "rock", "hawaiian", "latin hip hop", "latin electro", "pop rock", "dark rock", "garage rock", "chart hits", "dance", "latin folk", "forró", "new age", "alternative hip hop", "french pop", "symphonic metal", "southern rock", "comedy", "salsa", "euro dance industrial", "bulgarian music", "progressive rock"}
I want all matches that do NOT contain "Latin" OR "Italian" "Rock" and "Metal", but all others containing "Rock" and "Metal".
The glob is done in lowercase/case_insensitive
The glob:
{[!Latin],[!Italian]}{*Rock,*Metal*}
helps me to get:
"dark rock", "progressive metal", "pop rock", "heavy metal", "folk rock", "glam metal", "power metal", "punk rock", "heartland rock", "wagnerian rock", "blues rock", "funk rock", "folk metal", "glam rock", "garage rock", "psychedelic rock", "progressive rock", "celtic rock", "country rock", "southern rock", "hard rock", "soft rock", "roots rock", "symphonic metal", "rap metal"
What I do not understand: The documentation tells me that ...[ab] matches the a or b where a and b are characters. Use [!ab] to match any except from a and b.... Why is it not excepting e.g. folk metal as the L and the l are in the except? Or is the match the word in between...
So far I get what I want, but I would really be happy to understand that as I found the solution by chance.
If you need some source code, there is the repsective function: https://github.com/CDrummond/bliss-mixer/blob/c08b79ea271d7c631d45fbece6b619d74fb144a3/src/api.rs#L188
Beta Was this translation helpful? Give feedback.
All reactions