When I double tap on an image url when using Safari, the selected text includes the extension only if the filename is lower case. Why?
This is a quirk of the UAX #29 standard on Unicode word segmentation boundaries.  Basically, this document specifies standard rules for determining what's a &quot;word&quot; in a string of Unicode text.  Cocoa Text (the macOS text subsystem) conforms to these rules when implementing features like &quot;double click to select a word&quot;.
Using uniseg, a Python library that implements these rules, we can see the word boundaries for these two strings:
In [1]: list(uniseg.wordbreak.words(&quot;JOKd4.jpg&quot;))                                                                                 
Out[1]: ['JOKd4', '.', 'jpg']

In [2]: list(uniseg.wordbreak.words(&quot;eFGbq.jpg&quot;))                                                                                
Out[2]: ['eFGbq.jpg']

In the first case, UAX #29 rules specify there are three words in the text (which you can check by trying to double-tap select each piece one by one).  In the second case, it specifies there is only one word.
This should be standard behavior across Cocoa apps, but overridable by individual apps if they care to.  Chrome, presumably, implements an override for text / word selection behavior beyond the Cocoa default.  I'm not sure if there is a way for users to override this behavior without access to source code.