🐞 fix: 修复网址正则

This commit is contained in:
imsyy 2024-02-01 18:05:53 +08:00
parent 71663fd222
commit ad58785dc4
No known key found for this signature in database
GPG Key ID: 5D959EAB73CA095D

View File

@ -9,10 +9,8 @@ const identifyInput = (input) => {
* 网址正则
* @type {RegExp}
*/
const urlRegex = new RegExp(
"^(http://www.|https://www.|http://|https://)?[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?$",
);
const urlRegex = new RegExp("https?://[\\w.-]+", "i");
/**
* IP 正则
* @type {RegExp}