File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,14 +116,14 @@ document.addEventListener("DOMContentLoaded", () => {
116116 // Validate IP address format
117117 function validateIP ( ip ) {
118118 const regex =
119- / ^ ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \. ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) $ / ;
119+ / ^ ( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \\ .( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \\ .( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) \ \ .( 2 5 [ 0 - 5 ] | 2 [ 0 - 4 ] [ 0 - 9 ] | [ 0 1 ] ? [ 0 - 9 ] [ 0 - 9 ] ? ) $ / ;
120120 return regex . test ( ip ) ;
121121 }
122122
123123 // Validate URL format
124124 function validateURL ( url ) {
125125 const regex =
126- / ^ ( h t t p s ? : \/ \ /) ? (?: [ a - z 0 - 9 ] (?: [ a - z 0 - 9 - ] * [ a - z 0 - 9 ] ) ? \. ) + [ a - z ] { 2 , 6 } ( : [ 0 - 9 ] { 1 , 5 } ) ? ( \/ .* ) ? $ / i;
126+ / ^ ( h t t p s ? : \\ / \\ / ) ?( ?:[ a - z0 - 9 ] ( ?:[ a - z0 - 9 - ] * [ a - z0 - 9 ] ) ?\\ . ) + [ a - z ] { 2 , 6 } ( :[ 0 - 9 ] { 1 , 5 } ) ?( \ \/ . * ) ?$ / i ;
127127 return regex . test ( url ) ;
128128 }
129129} ) ;
You can’t perform that action at this time.
0 commit comments