cyd01 / KiTTY

:computer: KiTTY, a free telnet/ssh client for Windows
https://www.9bis.com/kitty
Other
1.61k stars 137 forks source link

Default URL regexp doesn't match with "new" gTLDs #444

Open teepox opened 1 year ago

teepox commented 1 year ago

I'm not a regexp wizard, but it looks like the current default URL regexp matches with two letter ccTLDs and a short list of statically defined gTLDs. However, the list of gTLDs has been expanding for 10 years now, so the regexp should be more generic. The one used by PuTTY-url for the last 5 years seems to be working correctly. It matches only http(s) and ftp URLs, though.

cyd01 commented 1 year ago

Feel free to propose an update

teepox commented 1 year ago

The one used by PuTTY-url is:

((https?|ftp)://|www.).(([^ ]([^ ]))([^ ()][^ ,;.:"')>])?|([^ ()][^ ,;.:"')>]))

cyd01 commented 1 year ago

Unfortunately, this regex does not work: [image: image.png]

Le mar. 10 janv. 2023 à 10:45, Tero Toikkanen @.***> a écrit :

The one used by PuTTY-url is:

((https?|ftp)://|www.).(([^ ]([^ ]))([^ ()][^ ,;.:"')>])?|([^ ()][^ ,;.:"')>]))

— Reply to this email directly, view it on GitHub https://github.com/cyd01/KiTTY/issues/444#issuecomment-1376985996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIESOBWZAGXUYLBDN4NQDDTWRUVS5ANCNFSM6AAAAAATMXINPA . You are receiving this because you commented.Message ID: @.***>

teepox commented 1 year ago

Unfortunately the image didn't come through to this issue, but I think the problem is that I didn't paste the string in as code snippet. Some of the characters were interpreted as formatting, so they were dropped out... If this doesn't show up correctly: ((https?|ftp)://|www\.).(([^ ]*\([^ ]*\))([^ ()]*[^ ,;.:"')>])?|([^ ()]*[^ ,;.:"')>])) Then the regexp used by PuTTY-URL can be found in the change log here: https://ryara.net/putty-url/