mirror of
https://github.com/caojiezi2003/Snavigation.git
synced 2024-11-23 10:59:46 +00:00
🐞 fix: 修复网址正则错误
This commit is contained in:
parent
2edc0cfd62
commit
71663fd222
@ -9,11 +9,17 @@ const identifyInput = (input) => {
|
|||||||
* 网址正则
|
* 网址正则
|
||||||
* @type {RegExp}
|
* @type {RegExp}
|
||||||
*/
|
*/
|
||||||
const urlRegex =
|
const urlRegex = new RegExp(
|
||||||
/^(?:(?:(?:https?|ftp):)?\/\/)?(?:\d{1,3}(?:\.\d{1,3}){3}|[a-z0-9-]+\.[a-z]{2,})(?::\d+)?(?:\/[^?\s]*)?$/i;
|
"^(http://www.|https://www.|http://|https://)?[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?$",
|
||||||
|
);
|
||||||
const ipv4Regex =
|
|
||||||
/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
/**
|
||||||
|
* IP 正则
|
||||||
|
* @type {RegExp}
|
||||||
|
*/
|
||||||
|
const ipv4Regex = new RegExp(
|
||||||
|
"^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮箱正则
|
* 邮箱正则
|
||||||
|
Loading…
Reference in New Issue
Block a user