The strings I referred to as metadata were obtained using ExifTool. Therefore, the Lens Model obtained from the metadata using ExifTool is “RF24-105mm F4 L IS USM” (within quotes).
I thought it should be possible for me to select a lens from a list but prior to making this post I was unable to figure out how. I thought the down arrows next to the button might be there for that purpose but selecting those did NOT produce a list. After seeing a reply to this post saying it was possible I went hunting again and figured out that selecting the button instead lead to the list.
Interestingly, in the case of RF lenses (i.e., for Canon mirrorless cameras) what appears in the list does match what’s found in LensFun file mil.canon.xml which seems to confirm that the list could have been created using the LensFun supplied data.
What’s odd is that for EF lenses (i.e., for Canon SLR cameras) the LensFun file slr.canon.xml appends the metadata value for Lens Model to the prefix "Canon " (i.e., the prefix is NOT included in the metadata) to obtain a value in the form mentioned (e.g., “Canon RF 24-105mm F4L IS USM”).
Your point about spacing is also interesting. The “F4L” rather than “F4 L” is a difference that appears in the metadata. The former (“F4L”) is what appears in the Makernotes element referred to as “RF Lens Type” rather than the Exif element referred to as “Lens Model” which contains “F4 L”.
Also, when I select the value “RF24-105mm F4 L IS USM” from the list Darktable displays it with a prefix of "Canon, ". The camera brand name “Canon” is the value used as the name of the applicable sub-folder that contains the lens models. This results in a string that is similar to but NOT quite the same as what is displayed in my screenshot where it says “Lens not found”. Therefore, I still haven’t figured out where the value displayed in my screenshot came from.
I am curious about the source of your LensFun data files.
With that said now that I know how to search the list of lens identifiers this is a much less serious problem.