Page 1 of 1

Checking if any fields are present in mediainfo

Posted: 03 Sep 2019, 20:19
by devster
I'm trying to look through mediainfo bindings to see if there are specific fields matching a regex.
The following, however, doesn't seem to work:

Code: Select all

video.first().findAll { k, v -> k ==~ /^colour_*/ }

Expression yields empty value: No signature of method: Script1160$_run_closure1.call() is applicable for argument types: (Entry) values: [Count=378]
Possible solutions: any(), any(), any(groovy.lang.Closure), tap(groovy.lang.Closure), each(groovy.lang.Closure), any(groovy.lang.Closure)
Any solutions?

Re: Checking if any fields are present in mediainfo

Posted: 04 Sep 2019, 02:27
by kim

Code: Select all

{
video.first().findAll { it =~ /^colour_.+/ }
}

Re: Checking if any fields are present in mediainfo

Posted: 04 Sep 2019, 03:13
by rednoah
You can specifically match the key like so:

Code: Select all

{video[0].findAll{ it.key =~ /^colour_/ }}