You do it with X resources. I have a file,
.Xresources, that contains these xterm-related resources:
.xinitrc file, I have some line that merge in those resources:
if [ -f $userresources ]; then
/usr/X11/bin/xrdb -merge $userresources
Those lines make xterm double-clicks and triple-clicks do what I like:
Double-click considers a "word" to include slash (/), dot (.), asterisk (*) and some other non-alphanumeric characters. That's the "charClass" resource. I had to do some tedious fiddling with that charClass to get it to do what I want. That mostly lets you double-click on URLs and fully- or partially-qualified paths to highlight them.
The other two lines make triple-click start from the word under the mouse, and go to the end of the line, but not include any new-line. That way, you can triple click on a command you just executed, paste it in another window, and because it has no new-line, you can edit it before running it in the other window.
The Arch Wiki has an article on X resources, including a section on xterm resources, but those xterm resources aren't complete.