Open teepox opened 1 year ago
Feel free to propose an update
The one used by PuTTY-url is:
((https?|ftp)://|www.).(([^ ]([^ ]))([^ ()][^ ,;.:"')>])?|([^ ()][^ ,;.:"')>]))
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: @.***>
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/
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.