Can a URL contain a semicolon and still be valid?

前端 未结 7 1476
故里飘歌
故里飘歌 2020-11-30 04:47

I am using a regular expression to convert plain text URL to clickable links.

@(https?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.-]*(\\?\\S+)?)?)?)@

Ho

7条回答
  •  醉梦人生
    2020-11-30 05:06

    http://www.ietf.org/rfc/rfc3986.txt covers URLs and what characters may appear in unencoded form. Given that URLs containing semicolons work properly in browsers, your code should support them.

提交回复
热议问题